Browse Source

Move slash commands to a separate file

pull/18/head
Abheek Dhawan 3 years ago
parent
commit
4fb81dcb6e
Signed by: abheekd GPG Key ID: 7BE81B8C14475B67
  1. 103
      index.js
  2. 101
      slashCommands.json

103
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);

101
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"
}
]
Loading…
Cancel
Save