From 1b43856926e29e547a356fd42e33160f167e2138 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Tue, 7 Apr 2020 05:16:54 -0700 Subject: added gavin wahoo 1.2.10 --- app.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'app.js') diff --git a/app.js b/app.js index 2822433..da340c3 100644 --- a/app.js +++ b/app.js @@ -4,6 +4,7 @@ const bot = new Discord.Client(); const isImageUrl = require('is-image-url'); const emoji = require('emoji-random'); const atquotes = require('at-quotes'); +const ytdl = require('ytdl-core'); bot.on('ready', () => { console.log(`Started bot: ${bot.user.tag} (ID: ${bot.user.id})\nCurrently running on ${bot.guilds.size} server(s).`); // Startup dialouge in output console @@ -351,7 +352,24 @@ bot.on('message', async msg => { msg.reply('you need to join a voice channel first silly'); } } - + + if (command == 'wahoo' | command == 'frozen' | command == 'frozenyyy') { + if (msg.member.voiceChannel && !msg.guild.voiceConnection) { + const connection = await msg.member.voiceChannel.join(); + const dispatcher = connection.playFile('./assets/audio/wahoo.mp3', { + volume: 1.0 + }); + + 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