summaryrefslogtreecommitdiff
path: root/commands/psycho.js
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-07 10:38:48 -0700
committer8cy <[email protected]>2020-04-07 10:38:48 -0700
commit1885ab12c73c7a79a2e7d1a8055f9bd2b0a7f71b (patch)
tree67f050cc81dea4b9b21f0d0349ecbdb263ecf221 /commands/psycho.js
parentport all the stuff from app.js to commands/ (diff)
downloads5nical-1885ab12c73c7a79a2e7d1a8055f9bd2b0a7f71b.tar.xz
s5nical-1885ab12c73c7a79a2e7d1a8055f9bd2b0a7f71b.zip
final test push before master
Diffstat (limited to 'commands/psycho.js')
-rw-r--r--commands/psycho.js25
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