From 02d47957481f1385a92cd20e73206b27745c21d1 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Fri, 10 Apr 2020 14:26:04 -0700 Subject: reworks, v2.0.5 --- app.js | 2 +- commands/utility/botstatus.js | 117 ++++++++++++++++++++++++++++++++++++++++++ commands/voice/itemshop.js | 4 +- commands/voice/moan.js | 29 +++++++++++ commands/voice/resume.js | 4 +- commands/voice/uhhhh.js | 29 ----------- 6 files changed, 151 insertions(+), 34 deletions(-) create mode 100644 commands/utility/botstatus.js create mode 100644 commands/voice/moan.js delete mode 100644 commands/voice/uhhhh.js diff --git a/app.js b/app.js index 67ff586..2b44ed8 100644 --- a/app.js +++ b/app.js @@ -32,7 +32,7 @@ client.registry ]) .registerDefaultGroups() .registerDefaultCommands({ - help: false + help: true }) .registerCommandsIn(path.join(__dirname, 'commands')); diff --git a/commands/utility/botstatus.js b/commands/utility/botstatus.js new file mode 100644 index 0000000..abea7c2 --- /dev/null +++ b/commands/utility/botstatus.js @@ -0,0 +1,117 @@ +const { Command } = require('discord.js-commando'); +const emoji = require('discord.js'); + +module.exports = class BotStatusUtility extends Command { + constructor(client) { + super(client, { + name: 'botstatus', + aliases: ['status', 'bs'], + group: 'utility', + memberName: 'botstatus', + description: 'lets you change the bots status', + args: [ + { + key: 'userChangeType', + prompt: 'would you like to change the status message or type?', + type: 'string' + }, + { + key: 'userActivityName', + prompt: 'what would u like the message 2 be?', + type: 'string' + }, + { + key: 'userActivityType', + prompt: 'what would u like the status type to be?', + type: 'string' + } + ] + }); + } + run(msg, { userActivityName, userActivityType }) { + if (msg.member.hasPermission('KICK_MEMBERS')) { + var activityType = this.client.user.presence.activities[0].type; + var activityName = this.client.user.presence.activities[0].name; + + function activityTypeToWords() { + if (activityName == '0') { + var activityName = 'PLAYING'; + } else if (activityName == '1') { + var activityName = 'STREAMING'; + } else if (activityName == '2') { + var activityName = 'LISTENING'; + } else if (activityName == '3') { + var activityName = 'WATCHING'; + } + } + + if (userChangeType == 'reset' || userChangeType == 'r') { + this.client.user.setActivity('psycho ~uwu', { + type: 'LISTENING' + }); + msg.reply('status has been reset lol ' + emoji.random()); + } else if (userChangeType == 'format' || userChangeType == 'f') { + // Print full, proper format for the Discord.js setActivity() function + msg.reply('\n`' + this.client.user.setActivity.toString() + '`'); + } else if (userChangeType == 'message' || userChangeType == 'msg' || userChangeType == 'm') { + // This took way to long to complete lol, 2020/04/08, 00:12, my birthday lol + if (userChangeType == 'message') { + var m = userChangeType.join(' '); + var mf = m.slice(8, 22); + } else if (userChangeType == 'msg') { + var m = userChangeType.join(' '); + var mf = m.slice(4, 22); + } else if (userChangeType == 'm') { + var m = userChangeType.join(' '); + var mf = m.slice(2, 22); + } + + if (mf == 'reset' || mf == 'r') { + this.client.user.setActivity('psycho ~uwu', { + type: activityType + }); + + msg.reply('status message has been reset lol'); + } else { + this.client.user.setActivity(mf, { + type: activityType + }); + } + } else if (userChangeType == 'userChangeType' || args == 't') { + var m = userChangeType; + userChangeType.toLowerCase(); + if (userChangeType == 'playing' || userChangeType == 'p') { + var m = 'playing'; + + this.client.user.setActivity(activityName, { + type: 'playing' + }); + } else if (userChangeType == 'listening' || userChangeType == 'l') { + var m = 'LISTENING'; + + this.client.user.setActivity(activityName, { + type: m + }); + } else if (userChangeType == 'watching' || userChangeType == 'w') { + var m = 'WATCHING'; + + this.client.user.setActivity(activityName, { + type: m + }); + } else if (userChangeType == 'custom' || userChangeType == 'c') { + msg.reply('custom status is disabled due to discord api policies about self-botting :('); + } else if (userChangeType == 'reset' || userChangeType == 'r') { + this.client.user.setActivity(activityName, { + type: 'LISTENING' + }); + + msg.reply('status type has been reset lol'); + } + } else if (!args) { + msg.reply('no arguments specified'); + } + } else { + msg.reply('insufficent perms bruh'); + } + } +}; \ No newline at end of file diff --git a/commands/voice/itemshop.js b/commands/voice/itemshop.js index c7b4825..1466758 100644 --- a/commands/voice/itemshop.js +++ b/commands/voice/itemshop.js @@ -5,10 +5,10 @@ const emoji = require('emoji-random'); module.exports = class ItemShopVoice extends Command { constructor(client) { super(client, { - name: 'itemstop', + name: 'itemshop', aliases: ['is'], group: 'voice', - memberName: 'itemstop', + memberName: 'itemshop', description: 'use code frozen in the itemshop', guildOnly: true }); diff --git a/commands/voice/moan.js b/commands/voice/moan.js new file mode 100644 index 0000000..a28480f --- /dev/null +++ b/commands/voice/moan.js @@ -0,0 +1,29 @@ +const { Command } = require('discord.js-commando'); +const emoji = require('emoji-random'); + +module.exports = class MoanVoice extends Command { + constructor(client) { + super(client, { + name: 'moan', + aliases: ['uhhhh'], + group: 'voice', + memberName: 'moan', + description: 'uhhhh', + guildOnly: true + }); + } + async run(msg) { + if (msg.member.voice.channel && !msg.guild.voice) { + const connection = await msg.member.voice.channel.join(); + const dispatcher = connection.play('./assets/audio/uhhhh.wav'); + + 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 diff --git a/commands/voice/resume.js b/commands/voice/resume.js index ea88ba1..74b555b 100644 --- a/commands/voice/resume.js +++ b/commands/voice/resume.js @@ -4,9 +4,9 @@ const emoji = require('emoji-random'); module.exports = class ResumeVoice extends Command { constructor(client) { super(client, { - name: 'resumes', + name: 'resume', group: 'voice', - memberName: 'resumes', + memberName: 'resume', description: 'resumes music if there is any stopped', guildOnly: true }); diff --git a/commands/voice/uhhhh.js b/commands/voice/uhhhh.js deleted file mode 100644 index a28480f..0000000 --- a/commands/voice/uhhhh.js +++ /dev/null @@ -1,29 +0,0 @@ -const { Command } = require('discord.js-commando'); -const emoji = require('emoji-random'); - -module.exports = class MoanVoice extends Command { - constructor(client) { - super(client, { - name: 'moan', - aliases: ['uhhhh'], - group: 'voice', - memberName: 'moan', - description: 'uhhhh', - guildOnly: true - }); - } - async run(msg) { - if (msg.member.voice.channel && !msg.guild.voice) { - const connection = await msg.member.voice.channel.join(); - const dispatcher = connection.play('./assets/audio/uhhhh.wav'); - - 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 -- cgit v1.2.3