From 4fb81dcb6e6266650024b4823c2c40d6d942f8c3 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 15 Jan 2022 22:43:14 -0600 Subject: [PATCH] Move slash commands to a separate file --- index.js | 103 +-------------------------------------------- slashCommands.json | 101 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 102 deletions(-) create mode 100644 slashCommands.json diff --git a/index.js b/index.js index 0bfcf48..4b9b897 100755 --- a/index.js +++ b/index.js @@ -18,108 +18,7 @@ const config = require("./config.json"); const decode = require('html-entities').decode; const helpMessage = "AwesomeSciBo has migrated to using slash commands! You can take a look at the different commands by typing `/` and clicking on the AwesomeSciBo icon." - -const slashCommands = [ - { - "name": "train", - "description": "Sends a single training question to be answered", - "options": [ - { - "type": 3, - "name": "subject", - "description": "Optional subject to be used as a filter", - "default": false, - "required": false, - "choices": [ - { - "name": "astro", - "value": "astro", - }, - { - "name": "bio", - "value": "bio", - }, - { - "name": "ess", - "value": "ess", - }, - { - "name": "chem", - "value": "chem", - }, - { - "name": "phys", - "value": "phys", - }, - { - "name": "math", - "value": "math", - }, - { - "name": "energy", - "value": "energy", - } - ] - } - ] - }, - { - "name": "help", - "description": "Replies with a help message explaining what the bot can do" - }, - { - "name": "rounds", - "options": [ - { - "type": 1, - "name": "generate", - "description": "Generates a round with randomized questions from https://scibowldb.com/", - "options": [] - }, - { - "type": 1, - "name": "list", - "description": "Lists your 5 most recently generated rounds with links", - "options": [] - }, - { - "type": 1, - "name": "hit", - "description": "Shows the total number of rounds hit as well as the number for the specific user", - "options": [] - } - ], - "description": "Commands regarding rounds generated by AwesomeSciBo" - }, - { - "name": "top", - "description": "Lists top ten scores across servers (server specific leaderboard WIP)" - }, - { - "name": "about", - "options": [ - { - "type": 1, - "name": "contributors", - "description": "Lists contributors to the AwesomeSciBo bot", - "options": [] - }, - { - "type": 1, - "name": "changelog", - "description": "Lists the 5 most recent changes in a \"git log\" type format", - "options": [] - }, - { - "type": 1, - "name": "bot", - "description": "Lists information about AwesomeSciBo", - "options": [] - } - ], - "description": "Commands regarding the creation/development of the bot" - } -] +const slashCommands = require('./slashCommands.json') client.once("ready", () => { client.application.commands.set(slashCommands); diff --git a/slashCommands.json b/slashCommands.json new file mode 100644 index 0000000..7d382f8 --- /dev/null +++ b/slashCommands.json @@ -0,0 +1,101 @@ +[ + { + "name": "train", + "description": "Sends a single training question to be answered", + "options": [ + { + "type": 3, + "name": "subject", + "description": "Optional subject to be used as a filter", + "default": false, + "required": false, + "choices": [ + { + "name": "astro", + "value": "astro", + }, + { + "name": "bio", + "value": "bio", + }, + { + "name": "ess", + "value": "ess", + }, + { + "name": "chem", + "value": "chem", + }, + { + "name": "phys", + "value": "phys", + }, + { + "name": "math", + "value": "math", + }, + { + "name": "energy", + "value": "energy", + } + ] + } + ] + }, + { + "name": "help", + "description": "Replies with a help message explaining what the bot can do" + }, + { + "name": "rounds", + "options": [ + { + "type": 1, + "name": "generate", + "description": "Generates a round with randomized questions from https://scibowldb.com/", + "options": [] + }, + { + "type": 1, + "name": "list", + "description": "Lists your 5 most recently generated rounds with links", + "options": [] + }, + { + "type": 1, + "name": "hit", + "description": "Shows the total number of rounds hit as well as the number for the specific user", + "options": [] + } + ], + "description": "Commands regarding rounds generated by AwesomeSciBo" + }, + { + "name": "top", + "description": "Lists top ten scores across servers (server specific leaderboard WIP)" + }, + { + "name": "about", + "options": [ + { + "type": 1, + "name": "contributors", + "description": "Lists contributors to the AwesomeSciBo bot", + "options": [] + }, + { + "type": 1, + "name": "changelog", + "description": "Lists the 5 most recent changes in a \"git log\" type format", + "options": [] + }, + { + "type": 1, + "name": "bot", + "description": "Lists information about AwesomeSciBo", + "options": [] + } + ], + "description": "Commands regarding the creation/development of the bot" + } +]