internal static async Task <bool> SpecialExceptions(NeitsilliaError error, IMessageChannel chan, Player player) { switch (error.ErrorType) { case NeitsilliaErrorType.ReplyError: await chan.SendMessageAsync(error.ExtraMessage); return(true); case NeitsilliaErrorType.ReplyUI: { await chan.SendMessageAsync(error.ExtraMessage); switch (error.uitype) { case MsgType.CardGame: { Type type = Neitsillia.Gambling.Games.GamblingGame.GetGameType(player.ui.data); Neitsillia.Gambling.Games.IGamblingGame game = Neitsillia.Gambling.Games.GamblingGame.CreateInstance(type, player); var embed = ((Neitsillia.Gambling.Games.GamblingGame)game).GetEmbed(player).Build(); await player.NewUI(null, embed, await player.DMChannel(), player.ui.type, player.ui.data); } break; } return(true); } case NeitsilliaErrorType.CharacterIsNotSetUp: if (player != null) { if (player.ui.type == MsgType.AutoNewCharacter) { await CharacterCommands.AutoCharacter(player, chan, true); } else if (player.ui.type == MsgType.SetSkill || player.ui.type == MsgType.ConfirmSkills) { string[] arrays = player.ui.data.Split(';'); await CharacterCommands.SetSkills(player, chan, 0, Utils.JSON <int[]>(arrays[0]), Utils.JSON <bool[]>(arrays[1])); } else if (!await CharacterCommands.Set_Race(chan, player)) { await CharacterCommands.StarterAbilities(player, chan, 1); } return(true); } return(false); case NeitsilliaErrorType.CharacterAdventuring: if (player != null) { await Areas.AdventureStat(player, chan); return(true); } return(false); case NeitsilliaErrorType.CharacterIsResting: if (player != null) { await Areas.RestStat(player, chan); return(true); } return(false); default: return(false); } }