Example #1
0
            public async Task AddCommand([Remainder] string channelUrl)
            {
                (bool, string)isValidAndChannelName = ValidateChannelId(channelUrl);
                var msg = await ReplyAsync(isValidAndChannelName.Item1? "OK" : "That is not a valid channelId, please use http://johnnythetank.github.io/youtube-channel-name-converter/").ConfigureAwait(false);

                bool wasAdded = YoutubeModuleService.TryAdd(Context.Channel.Id, channelUrl, isValidAndChannelName.Item2, WatchType.Video);
                await msg.ModifyAsync(x => x.Content = wasAdded?$"OK, {isValidAndChannelName.Item2} added to Video-watchlist." : "OK, Channel already added.").ConfigureAwait(false);
            }
Example #2
0
            public async Task RemoveCommand([Remainder] string channelUrl)
            {
                bool wasAdded = YoutubeModuleService.TryRemove(Context.Channel.Id, channelUrl, WatchType.Video);

                await ReplyAsync(wasAdded? "OK, Channel removed." : "Channel is not subscribed to this channel.").ConfigureAwait(false);
            }
Example #3
0
 public async Task YoutubeListCommand()
 {
     await ReplyAsync(YoutubeModuleService.List(Context.Channel.Id)).ConfigureAwait(false);
 }