예제 #1
0
 public Funnies(UrbanService urbanService, CoronaService coronaService, MiscDatabaseMethodsService miscDb, EFContext db)
 {
     _coronaApi    = coronaService;
     _urbanService = urbanService;
     _miscDb       = miscDb;
     _db           = db;
 }
예제 #2
0
        public async Task Define([Summary("The word(s) to define")][Remainder]
                                 string words)
        {
            try
            {
                var service = new UrbanService();
                var data    = await service.Data(words);

                if (data.List.Length > 0)
                {
                    var list = data.List.First();

                    var builder = new EmbedBuilder
                    {
                        Author = new EmbedAuthorBuilder
                        {
                            Name = $"Definition for \"{list.Word}\"",
                            Url  = list.Permalink
                        },
                        Color  = new Color(239, 255, 0),
                        Title  = "\u200B",
                        Footer = new EmbedFooterBuilder
                        {
                            Text = $"By _{list.Author}_ | Result 1/{data.List.Length}"
                        }
                    };
                    builder.AddField("Definition", list.Definition);
                    builder.AddField("Example", list.Example);

                    await ReplyAsync("", embed : builder.Build());
                }
                else
                {
                    await ReplyAsync($"I couldn't define _\"{words}\"_ for you, sorry!");
                }
            } catch
            {
                await ReplyAsync("Whoops, couldn't define that for you.. Now you have to do it yourself! :confused:");
            }
        }
예제 #3
0
 public UrbanModule(UrbanService urbanService)
 {
     _urbanService = urbanService;
 }
예제 #4
0
 public void Setup()
 {
     _urbanService = new UrbanService();
 }