diff options
Diffstat (limited to 'commands/voice/psycho.js')
| -rw-r--r-- | commands/voice/psycho.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/commands/voice/psycho.js b/commands/voice/psycho.js new file mode 100644 index 0000000..35ae025 --- /dev/null +++ b/commands/voice/psycho.js @@ -0,0 +1,31 @@ +const ytdl = require('ytdl-core'); +const { Command } = require('discord.js-commando'); + +module.exports = class PsychoVoice extends Command { + constructor(client) { + super(client, { + name: 'psycho', + group: 'voice', + memberName: 'psycho', + description: 'plays the psycho by mase', + guildOnly: true + }); + } + async run(msg) { + if (msg.member.voice.channel && !msg.guild.voice) { + const connection = await msg.member.voice.channel.join(); + const stream = ytdl('https://www.youtube.com/watch?v=fnd_HSmAODs', { + filter: 'audioonly' + }); + const dispatcher = connection.play(stream); + + dispatcher.on('finish', () => { + connection.disconnect(); + }); + } else if (msg.guild.voice) { + msg.reply('i\'m already playing that lol'); + } else { + msg.reply('you need to join a voice channel first silly'); + } + } +};
\ No newline at end of file |