Example #1
0
        public async Task YouTubeSearch(CommandContext ctx,
                                        [Description("Video to find on YouTube")][RemainingText] string query)
        {
            if (!BotServices.CheckUserInput(query))
            {
                return;
            }
            var service = new YoutubeService();
            var results = await service.GetEmbeddedResults(query, 5, "video").ConfigureAwait(false);

            await ctx.RespondAsync("Search results for " + Formatter.Bold(query), embed : results).ConfigureAwait(false);
        }
Example #2
0
        public async Task YouTubeChannel(CommandContext ctx, [RemainingText] string query)
        {
            if (string.IsNullOrWhiteSpace(query))
            {
                await BotServices.SendErrorEmbedAsync(ctx, ":warning: Channel search query is required!");
            }
            else
            {
                await ctx.TriggerTypingAsync();

                var youTubeService = new YoutubeService();
                var output         = await youTubeService.GetEmbeddedResults(query, 5, "channel");

                await ctx.RespondAsync($"Search results for {Formatter.Bold(query)}", embed : output);
            }
        }