From 0673efc957052121d5125b9dfb226782a9739acc Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Tue, 7 Apr 2020 08:19:51 -0700 Subject: add yt test, 1.3.0 --- app.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app.js b/app.js index da340c3..62d1dd2 100644 --- a/app.js +++ b/app.js @@ -370,6 +370,24 @@ bot.on('message', async msg => { } } + if (command == 'yt-test') { + if (msg.member.voiceChannel && !msg.guild.voiceConnection) { + const connection = await msg.member.voiceChannel.join(); + const stream = ytdl('https://www.youtube.com/watch?v=3CS93CdMv_E', { filter: 'audioonly' }); + const dispatcher = connection.playStream(stream, { + volume: 0.5 + }); + + dispatcher.on('end', () => { + msg.member.voiceChannel.leave(); + }) + } else if (msg.guild.voiceConnection) { + msg.reply('i\'m already playing that lol') + } else { + msg.reply('you need to join a voice channel first silly'); + } + } + // Help if (command == 'help') { if (!args.length) { -- cgit v1.2.3