summaryrefslogtreecommitdiff
path: root/commands/voice/psycho.js
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-10 10:16:53 -0700
committer8cy <[email protected]>2020-04-10 10:16:53 -0700
commit4b308538961facb87d73fafeab7fab5927562eff (patch)
tree8eaf88c074c379d76e7932e6fc3f32c05adb70ca /commands/voice/psycho.js
parentrework reboot, work on itemshop, v1.5.2 (diff)
downloads5nical-4b308538961facb87d73fafeab7fab5927562eff.tar.xz
s5nical-4b308538961facb87d73fafeab7fab5927562eff.zip
port to commando/ v12, 2.0.0
ported everything over to v12 and then commando in the span of 2 days no sleep lol. also now using typescript standard for cool 8)
Diffstat (limited to 'commands/voice/psycho.js')
-rw-r--r--commands/voice/psycho.js31
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