コード例 #1
0
        public async Task SearchMovie([Remainder] string search)
        {
            MediaFetchHandler.Movie media = MediaFetchHandler.FetchMovie(search);

            string RTScore = "N/A", IMDBScore;

            for (int i = 0; i < media.Ratings.Length; i++)
            {
                if (media.Ratings[i].Source == "Rotten Tomatoes")
                {
                    RTScore = media.Ratings[i].Value;
                }
            }

            IMDBScore = media.imdbRating == "N/A" ? "N/A" : $"{media.imdbRating}/10";

            await Context.Channel.SendMessageAsync(null, false, new EmbedBuilder()
                                                   .WithTitle($":film_frames: {media.Title} ({media.Year})")
                                                   .WithThumbnailUrl(media.Poster)
                                                   .WithDescription(media.Plot)
                                                   .AddField("Director", media.Director)
                                                   .AddField("Runtime", media.Runtime)
                                                   .AddField("Box Office", media.BoxOffice)
                                                   .AddField("IMDB Score", IMDBScore)
                                                   .AddField("Rotten Tomatoes", RTScore)
                                                   .WithColor(Utilities.DomColorFromURL(media.Poster))
                                                   .Build());
        }
コード例 #2
0
        public async Task SearchShows([Remainder] string search)
        {
            MediaFetchHandler.Movie media = MediaFetchHandler.FetchMovie(search);

            string IMDBScore = media.imdbRating == "N/A" ? "N/A" : $"{media.imdbRating}/10";

            media.Year = media.Year.Replace("–", "-");

            await Context.Channel.SendMessageAsync(null, false, new EmbedBuilder()
                                                   .WithTitle($":film_frames: {media.Title} ({media.Year})")
                                                   .WithThumbnailUrl(media.Poster)
                                                   .WithDescription(media.Plot)
                                                   .AddField("Runtime", media.Runtime)
                                                   .AddField("IMDB Score", IMDBScore)
                                                   .WithColor(Utilities.DomColorFromURL(media.Poster))
                                                   .Build());
        }