Exemplo n.º 1
0
        public async Task JoinChannel([Remainder] string uri)
        {
            IVoiceChannel channel = (Context.Message.Author as IGuildUser).VoiceChannel;

            if (channel == null)
            {
                await ReplyAsync("You should join a voice channel");

                return;
            }

            List <Song> s = await _service.getSuggestions(Context.Guild, uri);

            if (s.Count == 0)
            {
                await ReplyAsync("No songs found with the search term");

                return;
            }

            string song = await _service.AddSong(Context.Guild, channel, s[0].wathchID);

            if (song != null)
            {
                await ReplyAsync("Added song:  " + "**" + song + "**");
            }
            else
            {
                await ReplyAsync("Something went wrong");
            }
        }