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()); }); }
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)); }); }