Esempio n. 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);
            }