My members / staff cant see/use slash commands

The following pic are the commands what they should see
No description
26 Replies
d.js toolkit
d.js toolkit4w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
P H O E T A N I X
But this is what they actually see
Syjalo
Syjalo4w ago
Did you register the app on the guild, not on your user? Did you set default member permissions? Do they have Use App Commands permission? Is there any overrides in Server settings > Integrations > The bot > Commands > Permissions
P H O E T A N I X
Somehow only admins can see. Eventhough i never set defaultpermissions and use databanks to limit access instead 1. yes. The bot is installed guild 2. no i removed it and use another technique like databank verification 3. yes since they moderator 4. i will have to look for this The bot is not in integration only dyno And some other
Syjalo
Syjalo4w ago
The bot is not registered in the guild then
P H O E T A N I X
But the admins can use? sorry ping Mistake I can literally ping it in the server And prefix commands works as well
Syjalo
Syjalo4w ago
I'm not sure what is wrong then
P H O E T A N I X
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const db = require('../../databank/dbConnector.js'); const { registerUser, userExists, getUserRole, } = require("../../helper/db-cmds.js"); module.exports = { data: new SlashCommandBuilder() .setName("lock") .setDescription("Locks the current channel.") , async execute(interaction) { This is my lock slash for example Sorry im on phone Cant embed it This only works for admins or higher option .setName("field1_inline") .setDescription("Display field 1 inline?") .setRequired(false) ) // Field 2 options. .addStringOption((option) => option .setName("field2_name") .setDescription("Name for field 2") .setRequired(false) ) .addStringOption((option) => option .setName("field2_value") .setDescription("Value for field 2") .setRequired(false) ) .addBooleanOption((option) => option .setName("field2_inline") .setDescription("Display field 2 inline?") .setRequired(false) ), This works for everyone :nooo: My phone is making fun of me sigh
Syjalo
Syjalo4w ago
Can you show how you register commands?
P H O E T A N I X
require("dotenv").config(); const { REST, Routes } = require("discord.js"); const fs = require('node:fs'); const path = require('node:path'); const commands = []; const commandsPath = path.join(__dirname, 'src/cmds/slash'); const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js')); for (const file of commandFiles) { const filePath = path.join(commandsPath, file); const command = require(filePath); if ('data' in command && 'execute' in command) { commands.push(command.data.toJSON()); } else { console.log([WARNING] The command at ${filePath} is missing a required "data" or "execute" property.); } } const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN); (async () => { try { console.log(Started refreshing ${commands.length} application (/) commands.); const data = await rest.put( Routes.applicationCommands(process.env.APP_ID), { body: commands }, ); console.log(Successfully reloaded ${data.length} application (/) commands.); } catch (error) { console.error(error); } })(); Sorry i pinged again
Syjalo
Syjalo4w ago
No worries
P H O E T A N I X
Some ppls got mad when i asked earlier
Syjalo
Syjalo4w ago
Just don't ping random people or if they haven't answered in a while
P H O E T A N I X
I didnt. I literally just reply like this right now on their msg So no one knows the problem? Please ping me if someone got an idea or a solution
Azrael⛧⸸
Azrael⛧⸸4w ago
try do console.log(comman.data) and check if any of them set defaultmemberpermissions anywhere and everytime you register commands globally you need to refresh discord, i dont remember about guild commands tho
P H O E T A N I X
The fun fact is that everybody who got the admin role ( with administration perms ) have access to all the slash commands. Without installing on their accs The commands are there since ages already. Only lock and unlock is new Where? In the commands? Or main.js
P H O E T A N I X
This is everything I cant try on pc right now bc im at work Ok mb lemme go to browser rq
P H O E T A N I X
everything yes they had it then i changed the system i usually run deploy-commands.js when testing omg what. ok I will never use default perms again ok ty i will try to apply this when im home
P H O E T A N I X
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
P H O E T A N I X
Why not just delete them all and deploy them all again And yes i fixed it Thank you guys
treble/luna
treble/luna4w ago
Because it is totally unnecessary PUT overrides ah, my bad, wasnt sure about that

Did you find this page helpful?