summaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-08 20:02:33 -0700
committer8cy <[email protected]>2020-04-08 20:02:33 -0700
commit419467085d42d47f270e5ee1dda8676134e66c41 (patch)
tree0da5c310931e8598a5e0bb881d9dbaeea28f42eb /commands
parentfix uptime, v1.4.3 (diff)
downloads5nical-419467085d42d47f270e5ee1dda8676134e66c41.tar.xz
s5nical-419467085d42d47f270e5ee1dda8676134e66c41.zip
big changes, v1.5.0
- add utils - add fun commands - alter some commands - optimizations
Diffstat (limited to 'commands')
-rw-r--r--commands/abee.js5
-rw-r--r--commands/fart.js23
-rw-r--r--commands/itemshop.js25
-rw-r--r--commands/psycho.js5
-rw-r--r--commands/squeak.js6
-rw-r--r--commands/uhhhh.js6
-rw-r--r--commands/volume.js15
-rw-r--r--commands/wahoo.js6
8 files changed, 72 insertions, 19 deletions
diff --git a/commands/abee.js b/commands/abee.js
index 3cde38b..ced7c10 100644
--- a/commands/abee.js
+++ b/commands/abee.js
@@ -1,4 +1,5 @@
const ytdl = require('ytdl-core');
+const voice_check_dialog = require('../utils/voice_check_dialog.js');
module.exports = {
name: 'abee',
@@ -17,10 +18,8 @@ module.exports = {
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');
+ voice_check_dialog.execute(msg);
}
}
}; \ No newline at end of file
diff --git a/commands/fart.js b/commands/fart.js
index de62889..d2fbeb5 100644
--- a/commands/fart.js
+++ b/commands/fart.js
@@ -1,8 +1,25 @@
+const voice_check_dialog = require('../utils/voice_check_dialog.js');
+const bot_voice_check = require('../utils/bot_voice_check.js');
+
module.exports = {
name: 'fart',
+ aliases: ['f'],
description: '',
async execute(msg, args, bot) {
- if (msg.member.voiceChannel && !msg.guild.voiceConnection) {
+ if (args[0] == 'long' || args[0] == 'longest' || args[0] == 'l') {
+ if (msg.member.voiceChannel && !msg.guild.voiceConnection) {
+ const connection = await msg.member.voiceChannel.join();
+ const dispatcher = connection.playFile('./assets/audio/longest_fart_ever.mp3', {
+ volume: 1.0
+ });
+
+ dispatcher.on('end', () => {
+ msg.member.voiceChannel.leave();
+ });
+ } else {
+ voice_check_dialog.execute(msg);
+ }
+ } else if (msg.member.voiceChannel && !msg.guild.voiceConnection) {
const connection = await msg.member.voiceChannel.join();
var fartNum = Math.floor((Math.random() * 8) + 1);
@@ -71,10 +88,8 @@ module.exports = {
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');
+ voice_check_dialog.execute(msg);
}
}
}; \ No newline at end of file
diff --git a/commands/itemshop.js b/commands/itemshop.js
new file mode 100644
index 0000000..838d4f4
--- /dev/null
+++ b/commands/itemshop.js
@@ -0,0 +1,25 @@
+const ytdl = require('ytdl-core');
+
+module.exports = {
+ name: 'itemshop',
+ 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=pBiI1hTwU7E', {
+ 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
diff --git a/commands/psycho.js b/commands/psycho.js
index 9ecc8a1..13bca98 100644
--- a/commands/psycho.js
+++ b/commands/psycho.js
@@ -1,4 +1,5 @@
const ytdl = require('ytdl-core');
+const voice_check_dialog = require('../utils/voice_check_dialog.js');
module.exports = {
name: 'psycho',
@@ -16,10 +17,8 @@ module.exports = {
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');
+ voice_check_dialog.execute(msg);
}
}
}; \ No newline at end of file
diff --git a/commands/squeak.js b/commands/squeak.js
index a1c4046..fef4520 100644
--- a/commands/squeak.js
+++ b/commands/squeak.js
@@ -1,3 +1,5 @@
+const voice_check_dialog = require('../utils/voice_check_dialog.js');
+
module.exports = {
name: 'squeak',
description: '',
@@ -11,10 +13,8 @@ module.exports = {
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');
+ voice_check_dialog.execute(msg);
}
}
}; \ No newline at end of file
diff --git a/commands/uhhhh.js b/commands/uhhhh.js
index ccf94ff..e4d0330 100644
--- a/commands/uhhhh.js
+++ b/commands/uhhhh.js
@@ -1,3 +1,5 @@
+const voice_check_dialog = require('../utils/voice_check_dialog.js');
+
module.exports = {
name: 'uhhhh',
aliases: ['moan'],
@@ -12,10 +14,8 @@ module.exports = {
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');
+ voice_check_dialog.execute(msg);
}
}
}; \ No newline at end of file
diff --git a/commands/volume.js b/commands/volume.js
new file mode 100644
index 0000000..a809c1c
--- /dev/null
+++ b/commands/volume.js
@@ -0,0 +1,15 @@
+module.exports = {
+ name: 'volume',
+ aliases: ['vol'],
+ description: '',
+ async execute(msg, args, bot) {
+ msg.reply('volume is under works rn, just use the slider lol');
+ // if (!args) {
+ // msg.reply('no volume specified >:(');
+ // } else {
+ // var volume = args[0];
+
+ // dispatcher.setVolume(volume);
+ // }
+ }
+}; \ No newline at end of file
diff --git a/commands/wahoo.js b/commands/wahoo.js
index 713ee9d..a6e7c96 100644
--- a/commands/wahoo.js
+++ b/commands/wahoo.js
@@ -1,3 +1,5 @@
+const voice_check_dialog = require('../utils/voice_check_dialog.js');
+
module.exports = {
name: 'wahoo',
aliases: ['mario'],
@@ -12,10 +14,8 @@ module.exports = {
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');
+ voice_check_dialog.execute(msg);
}
}
}; \ No newline at end of file