summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author8cy <[email protected]>2020-05-04 03:38:09 -0700
committer8cy <[email protected]>2020-05-04 03:38:09 -0700
commit86d54afbc1490b7ff3a1246c07fa5c3b82a5272d (patch)
treedf73c31bb9e72dd3377155af78713447adae155f /src
parentadd npm copy scripts, v9.2.1 (diff)
downloaddep-core-86d54afbc1490b7ff3a1246c07fa5c3b82a5272d.tar.xz
dep-core-86d54afbc1490b7ff3a1246c07fa5c3b82a5272d.zip
add status changer, v9.2.2
Diffstat (limited to 'src')
-rw-r--r--src/commands/bot/status.ts88
-rw-r--r--src/config.json2
2 files changed, 89 insertions, 1 deletions
diff --git a/src/commands/bot/status.ts b/src/commands/bot/status.ts
new file mode 100644
index 0000000..272806f
--- /dev/null
+++ b/src/commands/bot/status.ts
@@ -0,0 +1,88 @@
+import { Command } from 'discord.js-commando';
+import emoji from 'emoji-random'
+import config from '../../config.json'
+
+module.exports = class StatusBot extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'status',
+ aliases: ['botstatus', 'bot-status'],
+ group: 'bot',
+ memberName: 'status',
+ description: 'Allows you to change the bots status',
+ args: [
+ {
+ key: 'uType',
+ prompt: 'Would you like to change the status type or status message?',
+ type: 'string',
+ default: ''
+ },
+ {
+ key: 'uActivity',
+ prompt: 'What would you like to set the status message to?',
+ type: 'string',
+ default: ''
+ }
+ ],
+ examples: [
+ 's5n!botstatus type watching',
+ 's5n!status t w',
+ 's5n!status message youtube',
+ 's5n!bs m lol'
+ ],
+ ownerOnly: true,
+ guarded: true
+ });
+ }
+ run(msg, { uType, uActivity }) {
+ let bType = this.client.user?.presence.activities[0].type;
+ let bActivity = this.client.user?.presence.activities[0].name;
+
+ function uActivityCheck() {
+ if (uActivity == 'playing' || uActivity == 'p') {
+ return true
+ } else if (uActivity == 'streaming' || uActivity == 's') {
+ return true
+ } else if (uActivity == 'listening' || uActivity == 'l') {
+ return true
+ } else if (uActivity == 'watching' || uActivity == 'w') {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ if (uType == 'type' || uType == 't') {
+ if (uActivity == 'reset' || uActivity == 'r') {
+ this.client.user?.setActivity(this.client.user.presence.activities[0].name, {
+ type: 'WATCHING'
+ });
+ } else {
+ if (uActivityCheck()) {
+ this.client.user?.setActivity(this.client.user.presence.activities[0].name, {
+ type: uActivity
+ });
+ // TODO: fix this not settings the type
+ } else {
+ return msg.reply(`That is not a valid status type. ${emoji.random()}`)
+ }
+ }
+ } else if (uType == 'message' || uType == 'msg' || uType == 'm') {
+ if (uActivity == 'reset' || uActivity == 'r') {
+ this.client.user?.setActivity('uwu!help | v' + config['version'], {
+ type: bType
+ });
+ } else {
+ this.client.user?.setActivity(uActivity, {
+ type: bType
+ });
+ }
+ } else if (uType == 'reset' || uType == 'r') {
+ this.client.user?.setActivity('uwu!help | v' + config['version'], {
+ type: 'WATCHING'
+ });
+ } else {
+ return msg.reply(`That was not an option. ${emoji.random()}`)
+ }
+ }
+}; \ No newline at end of file
diff --git a/src/config.json b/src/config.json
index 4a9aff1..caa75a4 100644
--- a/src/config.json
+++ b/src/config.json
@@ -1,7 +1,7 @@
{
"secret":"Njk5NDczMjYzOTk4MjcxNDg5.XpU5oQ.btZuxVudhNllSQY6CxrXXtMJm9A",
"yt-api-key":"AIzaSyCeG1lQAeInv4vjFv_eTL9IFAFNdQC9Nk8",
- "version":"9.2.1",
+ "version":"9.2.2",
"fortniteTrackerNetworkToken": "4cf21f95-5f1a-412a-b4a7-e5424adc314a",
"maxMultipler": 100,
"minMultipler": 1.01