diff options
| author | 8cy <[email protected]> | 2020-04-08 01:29:14 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-08 01:29:14 -0700 |
| commit | 48f1d2ad627deb12ffdc05a3db8f1198ffd3e611 (patch) | |
| tree | 838e300aaab34cf465daf55b4b2215a062b8aff0 | |
| parent | rework try/ catch loop to fix errors, v1.4.0 (diff) | |
| download | s5nical-48f1d2ad627deb12ffdc05a3db8f1198ffd3e611.tar.xz s5nical-48f1d2ad627deb12ffdc05a3db8f1198ffd3e611.zip | |
make botstatus command actually good, v1.4.1
took way too long but its amazing now
| -rw-r--r-- | commands/botstatus.js | 86 |
1 files changed, 80 insertions, 6 deletions
diff --git a/commands/botstatus.js b/commands/botstatus.js index 8f9a198..1feeb4f 100644 --- a/commands/botstatus.js +++ b/commands/botstatus.js @@ -1,17 +1,91 @@ // TODO: bot status +const Discord = require('discord.js'); + module.exports = { name: 'botstatus', aliases: ['status', 'bs'], description: '', async execute(msg, args, bot) { - t = 'LISTENING'; if (msg.member.hasPermission('KICK_MEMBERS')) { - - m = args.join(' '); - bot.user.setActivity(m, { - type: t - }); + var activityType = bot.user.presence.game.type; + var activityName = bot.user.presence.game.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 (args[0] == 'reset' || args[0] == 'r') { + bot.user.setActivity('psycho ~uwu', { + type: 'LISTENING' + }); + msg.reply('status has been reset lol'); + } else if (args[0] == 'format' || args[0] == 'f') { + // Print full, proper format for the Discord.js setActivity() function + msg.reply('\n`' + bot.user.setActivity.toString() + '`'); + } else if (args[0] == 'message' || args[0] == 'msg' || args[0] == 'm') { + // This took way to long to complete lol, 2020/04/08, 00:12, my birthday lol + if (args[0] == 'message') { + var m = args.join(' '); + var mf = m.slice(8, 22); + } else if (args[0] == 'msg') { + var m = args.join(' '); + var mf = m.slice(4, 22); + } else if (args[0] == 'm') { + var m = args.join(' '); + var mf = m.slice(2, 22); + } + + if (mf == 'reset' || mf == 'r') { + bot.user.setActivity('psycho ~uwu', { + type: activityType + }); + + msg.reply('status message has been reset lol'); + } else { + bot.user.setActivity(mf, { + type: activityType + }); + } + } else if (args[0] == 'type' || args[0] == 't') { + var m = args[1]; + args[1].toLowerCase(); + if (args[1] == 'playing' || args[1] == 'p') { + var m = 'playing'; + + bot.user.setActivity(activityName, { + type: m + }); + } else if (args[1] == 'listening' || args[1] == 'l') { + var m = 'LISTENING'; + + bot.user.setActivity(activityName, { + type: m + }); + } else if (args[1] == 'watching' || args[1] == 'w') { + var m = 'WATCHING'; + + bot.user.setActivity(activityName, { + type: m + }); + } else if (args[1] == 'reset' || args[1] == 'r') { + bot.user.setActivity(activityName, { + type: 'LISTENING' + }); + + msg.reply('status type has been reset lol'); + } + } else if (!args.length) { + msg.reply('no arguments specified'); + } } else { msg.reply('insufficent perms bruh'); } |