private async Task Raid() { if (Command.Count() < 4) { await Handler.MakeCommandMessage(Message.Channel, Parser.Language.Strings["commandInvalidNumberOfParameters"]); return; } var post = Parser.ParsePost(Message); if (post.PokemonId == default(int)) { await Handler.MakeCommandMessage(Message.Channel, string.Format(Parser.Language.Formats["commandRaidPokemonInvalid"], Command[1])); return; } if (post.HasEndDate == false) { await Handler.MakeCommandMessage(Message.Channel, string.Format(Parser.Language.Formats["commandRaidTimespanInvalid"], Command[2])); return; } var d = Message.Channel.EnterTypingState(); try { post.Location = Parser.ToTitleCase(string.Join(" ", Command.Skip(3))); post.FullLocation = Parser.GetFullLocation(post.Location, GuildConfig, Message.Channel.Id); if (GuildConfig.Places.ContainsKey(post.Location.ToLower())) { post.LatLong = GuildConfig.Places[post.Location]; } else post.LatLong = await Parser.GetLocationLatLong(post.FullLocation, Message.Channel, Config); if (string.IsNullOrWhiteSpace(post.Location)) { await Handler.MakeCommandMessage(Message.Channel, Parser.Language.Strings["commandRaidLocationInvalid"]); return; } post.IsValid = true; var outputchannel = !GuildConfig.OutputChannelId.HasValue || GuildConfig.OutputChannelId == 0 ? null : Message.Server.Channels.FirstOrDefault(x => x.Id == GuildConfig.OutputChannelId.Value); await Handler.DoPost(post, Message, Parser, outputchannel, true); } catch (Exception e) { Handler.DoError(e, "Executor"); } finally { d.Dispose(); } }