Ejemplo n.º 1
0
 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...`");
     }
 }
Ejemplo n.º 2
0
 public UrbanDictionaryService(UrbanClient uc)
 => UrbanDictionary = uc;
Ejemplo n.º 3
0
 public UrbanDictionaryService()
 {
     Client = new UrbanClient();
 }