Esempio n. 1
0
 private void registerRandomGif()
 {
     commands.CreateCommand("randomgif")
     .Alias(new String[] { "random", "rgif" })
     .Description("Send a random GIPHY gif to the chat!")
     .Do(async(e) =>
     {
         GiphyApi gifSearch = new GiphyApi(ConfigurationManager.AppSettings["giphyKey"]);
         await e.Channel.SendMessage(gifSearch.GetRandomGif());
     });
 }
Esempio n. 2
0
 private void registerAnimeGif()
 {
     commands.CreateCommand("animegif")
     .Alias(new String[] { "agif", "anime" })
     .Description("Send an anime related searh result gif")
     .Parameter("searchQuery", Discord.Commands.ParameterType.Required)
     .Do(async(e) =>
     {
         var filteredQuery = e.GetArg("searchQuery").ToString().Trim().ToLower().Replace("_", "+");
         Console.WriteLine(filteredQuery);
         GiphyApi animeGifSearch = new GiphyApi(ConfigurationManager.AppSettings["giphyKey"]);
         await e.Channel.SendMessage(animeGifSearch.GetAnimeGif(filteredQuery));
     });
 }