diff options
Diffstat (limited to 'commands/psycho.js')
| -rw-r--r-- | commands/psycho.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/commands/psycho.js b/commands/psycho.js new file mode 100644 index 0000000..9ecc8a1 --- /dev/null +++ b/commands/psycho.js @@ -0,0 +1,25 @@ +const ytdl = require('ytdl-core'); + +module.exports = { + name: 'psycho', + description: '', + async execute(msg, args, bot) { + if (msg.member.voiceChannel && !msg.guild.voiceConnection) { + const connection = await msg.member.voiceChannel.join(); + const stream = ytdl('https://www.youtube.com/watch?v=fnd_HSmAODs', { + 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'); + } + } +};
\ No newline at end of file |