public static async Task Urban(SocketMessage message, string[] arg, string msg) { if (arg.Count() > 1) { UrbanClient uc = new UrbanClient(); try { string w = msg.Substring(6); DefinitionData word; if (w == "random") { word = await uc.GetRandomWordAsync(); } else { word = (await uc.GetWordAsync(w)).FirstOrDefault(); } await message.Channel.SendMessageAsync("", false, genUrban(word)); } catch { await message.Channel.SendMessageAsync($":no_entry: `No results` :thinking:"); } } else { await message.Channel.SendMessageAsync($":no_entry: `Tell me which word to search...`"); } }
public UrbanDictionaryService(UrbanClient uc) => UrbanDictionary = uc;
public UrbanDictionaryService() { Client = new UrbanClient(); }