Do not have permissions to use my own bot the second time

just created my own slash + prefix cmd handler but there is a problem with the slash part after i use any one slash cmd and then go to use another one (of the same bot) it says that i do not have any permission to use commands of that bot ( it says this in the slash commands dialog ) box it can use it again just once if i refresh the discord client
20 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wen
wenOP2y ago
ask what files u need and i'll send it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wen
wenOP2y ago
no error like that
wen
wenOP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wen
wenOP2y ago
in my test server
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wen
wenOP2y ago
also in the server it says that there are no commands but i have used commands in the server
wen
wenOP2y ago
wen
wenOP2y ago
that part
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wen
wenOP2y ago
ok i'll lyk same in another server
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MrMythical
MrMythical2y ago
It sounds like a Discord bug But when they refresh it re appears
wen
wenOP2y ago
i i'll send my cmd handler
const { REST, Routes } = require("discord.js");
const { readdirSync } = require("fs");
const commands = [];
const clientId = client.user.id;

module.exports = async (client) => {
let cmd;
for (let dir of readdirSync("./commandsSlash/")) {
for (let command of readdirSync(`./commandsSlash/${dir}`)) {
cmd = require(`../commandsSlash/${dir}/${command}`);
commands.push(cmd.data.toJSON());
client.slash.set(cmd.data.name.toLowerCase(), cmd);
console.log(
colors.bgRed(`[Slash]:`),
colors.green(
cmd.data.name.replace(
cmd.data.name[0],
cmd.data.name[0].toUpperCase()
)
)
);
}
}

const rest = new REST({ version: "10" }).setToken(process.env.TOKEN);

(async () => {
try {
await rest.put(Routes.applicationCommands(clientId), {
body: commands,
});
} catch (error) {
console.log(error);
}
})();
};
const { REST, Routes } = require("discord.js");
const { readdirSync } = require("fs");
const commands = [];
const clientId = client.user.id;

module.exports = async (client) => {
let cmd;
for (let dir of readdirSync("./commandsSlash/")) {
for (let command of readdirSync(`./commandsSlash/${dir}`)) {
cmd = require(`../commandsSlash/${dir}/${command}`);
commands.push(cmd.data.toJSON());
client.slash.set(cmd.data.name.toLowerCase(), cmd);
console.log(
colors.bgRed(`[Slash]:`),
colors.green(
cmd.data.name.replace(
cmd.data.name[0],
cmd.data.name[0].toUpperCase()
)
)
);
}
}

const rest = new REST({ version: "10" }).setToken(process.env.TOKEN);

(async () => {
try {
await rest.put(Routes.applicationCommands(clientId), {
body: commands,
});
} catch (error) {
console.log(error);
}
})();
};
also about this pic i appeared once but after i used a slash cmd it disappeared again
MrMythical
MrMythical2y ago
This isn't related to discord.js It's a Discord bug
wen
wenOP2y ago
what am i supposed to do about it
MrMythical
MrMythical2y ago
tell discord
wen
wenOP2y ago
like delete this app and create a new one ? aight i deleted the old bot and made a new one and it works absolutely fine
Want results from more Discord servers?
Add your server