Exemplo n.º 1
0
        protected override async Task Handle(ImdbSearch request, CancellationToken cancellationToken)
        {
            var result = await omdbService.Search(request.term);

            var returnstring = new StringBuilder();

            returnstring.AppendLine($"I found these titles");
            foreach (var item in result.Take(5))
            {
                returnstring.AppendLine($"{ item.Title }({ item.Year }) *https://www.imdb.com/title/{ item.imdbID}*");
            }
            var eb = new EmbedBuilder()
            {
                Title = "Search results", Description = returnstring.ToString(), Color = Color.DarkOrange
            };

            //await Context.Channel.SendMessageAsync(returnstring.ToString());
            await request.Context.Channel.SendMessageAsync(embed : eb.Build());
        }
Exemplo n.º 2
0
        public void TestOmdbServiceServiceSearch()
        {
            var movies = _omdbService.Search("Braveheart");

            Assert.IsTrue(movies.Count > 0);
        }