summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-07 08:19:51 -0700
committer8cy <[email protected]>2020-04-07 08:19:51 -0700
commit0673efc957052121d5125b9dfb226782a9739acc (patch)
tree2c34d8dfcbe5782db5e45b6d5ae06abe72f9d155
parentadded gavin wahoo 1.2.10 (diff)
downloads5nical-0673efc957052121d5125b9dfb226782a9739acc.tar.xz
s5nical-0673efc957052121d5125b9dfb226782a9739acc.zip
add yt test, 1.3.0legacy-pre-cmd-handler
-rw-r--r--app.js18
1 files changed, 18 insertions, 0 deletions
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) {