#```js
1 messages · Page 1 of 1 (latest)
// 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
try the code I sent you
client.application.commands.set(commands);```
here