summaryrefslogtreecommitdiff
path: root/commands/utility/reboot.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands/utility/reboot.js')
-rw-r--r--commands/utility/reboot.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/commands/utility/reboot.js b/commands/utility/reboot.js
new file mode 100644
index 0000000..031ff08
--- /dev/null
+++ b/commands/utility/reboot.js
@@ -0,0 +1,40 @@
+const { Command } = require('discord.js-commando');
+
+module.exports = class RebootUtility extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'reboot',
+ aliases: ['r', 're'],
+ group: 'utility',
+ memberName: 'reboot',
+ description: 'reboots a module(s)',
+ guildOnly: true,
+ args: [
+ {
+ key: 'module',
+ prompt: 'which module(s) would you like to reboot?',
+ type: 'integer'
+ }
+ ]
+ });
+ }
+ run(msg, { module }) {
+ if (module == 'voice' || module == 'v') {
+ if (!msg.member.voice.channel) {
+ msg.reply('you need to be in a voice channel to reboot the voice module');
+ } else if (!msg.guild.voice) {
+ msg.member.voice.channel.join();
+ msg.member.voice.channel.leave();
+ msg.reply('voice module reboot finished lol');
+ } else if (msg.guild.voice) {
+ msg.member.voice.channel.leave();
+ msg.member.voice.channel.join();
+ msg.reply('voice module reboot finished lol');
+ }
+ } else if (module == 'commands' || module == 'commands' || module == 'cmds' || module == 'cmd' || module == 'c') {
+ msg.reply('commands module reboot finished lol');
+ } else if (!args.length) {
+ msg.reply('no module(s) specified');
+ }
+ }
+}; \ No newline at end of file