mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-15 05:36:54 +00:00
Added Slash Command registration timing
This commit is contained in:
@@ -5,6 +5,7 @@ const {Client, Constants} = require('discord.js');
|
||||
* @param {Client} bot
|
||||
*/
|
||||
function registerCommands(bot) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const commands = bot.application.commands;
|
||||
|
||||
/*
|
||||
@@ -16,6 +17,8 @@ function registerCommands(bot) {
|
||||
|
||||
key: code
|
||||
*/
|
||||
|
||||
//#region Slash Commands
|
||||
bot.commands.forEach((val, key) => {
|
||||
if ((val.options && val.name != 'econ') || val.isDm) {
|
||||
if (val.isDm) {
|
||||
@@ -109,6 +112,28 @@ function registerCommands(bot) {
|
||||
},
|
||||
]
|
||||
});
|
||||
return resolve(true);
|
||||
//Takes much longer, so it'll be the benchmark for when the Promise resolves
|
||||
//#region GAMES
|
||||
const gameOpts = require('./commands/games/gameCommandOptions.js');
|
||||
commands.create({
|
||||
name: 'game',
|
||||
description: 'Play one of Selmer Bot\'s games!', //NOT APPLICABLE USING SUB COMMAND GROUPS???
|
||||
// type: Constants.ApplicationCommandOptionTypes.SUB_COMMAND_GROUP,
|
||||
options: gameOpts
|
||||
}).then(() => { resolve(true); }).catch((err) => { reject(err); });
|
||||
//#endregion
|
||||
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Context Menus
|
||||
commands.create({
|
||||
name: "Temp",
|
||||
type: 'USER'
|
||||
});
|
||||
//#endregion
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user