const commands = require('../index')
module.exports = {
name: 'ready',
once: true,
async execute(client) {
console.log(`[BOT] - ${client.user.tag} is online!`);
const guildIds = [
'833289549341523998',
'804731876950147122',
'882096964295082004',
'853617621547352104',
]
//Load Guild Commands
for (const guildId of guildIds) {
try{
await client.application.commands.set(commands, guildId)
}
catch(err) {
console.log(error)
}
}
console.log('Loaded Guild Commands')
},
};
I’m using this code in my bot’s ready
event to register my slash commands, but the commands only work for the first guild in the array. It simply returns This interaction failed
on the others.
Why?