mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 22:16:13 +00:00
feat!: Change interaction structure and handling of component responses
This commit is contained in:
1 parent
905df36ef8
commit
9b02b21283
24 files changed
+232
-239
No files matched your search
@@ -17,21 +17,21 @@ export const registerClientCommands = ({ client, executionId }: RegisterClientCo
|
||||
logger.debug('Registering client commands...');
|
||||
client.commands = new Collection();
|
||||
|
||||
const commandFolders = fs.readdirSync(path.resolve('./dist/commands'));
|
||||
const commandFolders = fs.readdirSync(path.resolve('./dist/interactions/commands'));
|
||||
for (const folder of commandFolders) {
|
||||
logger.trace(`Registering client commands for folder '${folder}'...`);
|
||||
const commandFiles = fs
|
||||
.readdirSync(path.resolve(`./dist/commands/${folder}`))
|
||||
.readdirSync(path.resolve(`./dist/interactions/commands/${folder}`))
|
||||
.filter((file) => file.endsWith('.js'));
|
||||
|
||||
for (const file of commandFiles) {
|
||||
try {
|
||||
// delete command from require cache
|
||||
delete require.cache[require.resolve(`../commands/${folder}/${file}`)];
|
||||
delete require.cache[require.resolve(`../interactions/commands/${folder}/${file}`)];
|
||||
|
||||
// register command
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const command = require(`../commands/${folder}/${file}`);
|
||||
const command = require(`../interactions/commands/${folder}/${file}`);
|
||||
client.commands.delete(command.data.name);
|
||||
client.commands.set(command.data.name, command);
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user