#```js

1 messages · Page 1 of 1 (latest)

cold sage
#
// Bot Command Handler
const commands = [];
client.commands = new Collection();
fs.readdir('./commands', (err, files) => {
  if (err) return console.log(err);
  files.forEach((file) => {
    if (!file.endsWith('.js')) return;
    const command = require(`./commands/**/${file}`);
    commands.push(command.data.toJSON());
    client.commands.set(command.data.name, command);
  })
})
#

@barren orbit here is the code , bot logged in but all its commands are not there in / , no commands of this bot is there

barren orbit
#
client.application.commands.set(commands);```
#

here

cold sage
#

nope

#

nothing happens

#

well fixed it , just a little mistake

#

have to get the ${dir} before getting the file