[Discord.js] My bot's slash commands are working in only one of the guilds I'm registering them in. Why?

const commands = require('../index')

module.exports = {
    name: 'ready',
    once: true,
    async execute(client) {
        console.log(`[BOT] - ${client.user.tag} is online!`);

        const guildIds = [
        //Load Guild Commands
        for (const guildId of guildIds) {
                await client.application.commands.set(commands, guildId)
            catch(err) {
        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.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.