Esempio n. 1
0
        public async Task YoutubeVideo(params string[] args)
        {
            Base.Utilities.CheckAvailability(Context.Guild, Program.Module.Youtube);
            await p.DoAction(Context.User, Program.Module.Youtube);

            var result = await Features.Entertainment.YouTube.SearchYouTube(args, Program.p.youtubeService);

            switch (result.error)
            {
            case Features.Entertainment.Error.YouTube.InvalidApiKey:
                await ReplyAsync(Base.Sentences.NoApiKey(Context.Guild));

                break;

            case Features.Entertainment.Error.YouTube.Help:
                await ReplyAsync(Sentences.YoutubeHelp(Context.Guild));

                break;

            case Features.Entertainment.Error.YouTube.NotFound:
                await ReplyAsync(Sentences.YoutubeNotFound(Context.Guild));

                break;

            case Features.Entertainment.Error.YouTube.None:
                await ReplyAsync(result.answer.url);

                break;

            default:
                throw new NotImplementedException();
            }
        }