Using Commands

my main discord account can access my bots commands but when i try to use commands from a second account nothing shows up for my bot, what would cause this to happen? Discord.js: 14.13.0 Node: 18.15.0 this is one of my commands when its registered
Command {
name: 'suggest',
description: 'Suggest an improvment for the discord bot',
UserPerms: [ 'SendMessages' ],
BotPerms: [ 'SendMessages' ],
defaultMemberPermissions: [ 'SendMessages' ],
type: 1,
options: [ [Object], [Object], [Object] ],
run: [AsyncFunction: run]
},
Command {
name: 'suggest',
description: 'Suggest an improvment for the discord bot',
UserPerms: [ 'SendMessages' ],
BotPerms: [ 'SendMessages' ],
defaultMemberPermissions: [ 'SendMessages' ],
type: 1,
options: [ [Object], [Object], [Object] ],
run: [AsyncFunction: run]
},
2 Replies
d.js toolkit
d.js toolkit10mo 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!
CanadienDragon
CanadienDragon10mo ago
would it be better to use a number for the default permissions instead of using the string? all commands are registered with this.application?.commands.set(commands); nope im the only person that can do anything with the discord server, and that command has always had the SendMessages permission reloading discord is the first thing i did just cleared out all my commands from discord re registering them now to see if anything changes yep, auto assigned when they click a button to get access to all the channels in the discord i checked to make sure, they do have it flushing the commands did nothing either they have the member role which has the UseApplicationCommand Permission
'1147471472038793290' => <ref *23> ApplicationCommand {
id: '1147471472038793290',
applicationId: '930882181595807774',
guild: null,
guildId: null,
permissions: ApplicationCommandPermissionsManager {
manager: [Circular *23],
guild: null,
guildId: null,
commandId: '1147471472038793290'
},
type: 1,
nsfw: false,
name: 'suggest',
nameLocalizations: null,
nameLocalized: null,
description: 'Suggest an improvment for the discord bot',
descriptionLocalizations: null,
descriptionLocalized: null,
options: [ [Object], [Object], [Object] ],
defaultMemberPermissions: PermissionsBitField { bitfield: 2048n },
dmPermission: true,
version: '1147471472223326275'
},
'1147471472038793290' => <ref *23> ApplicationCommand {
id: '1147471472038793290',
applicationId: '930882181595807774',
guild: null,
guildId: null,
permissions: ApplicationCommandPermissionsManager {
manager: [Circular *23],
guild: null,
guildId: null,
commandId: '1147471472038793290'
},
type: 1,
nsfw: false,
name: 'suggest',
nameLocalizations: null,
nameLocalized: null,
description: 'Suggest an improvment for the discord bot',
descriptionLocalizations: null,
descriptionLocalized: null,
options: [ [Object], [Object], [Object] ],
defaultMemberPermissions: PermissionsBitField { bitfield: 2048n },
dmPermission: true,
version: '1147471472223326275'
},
im not sure if thats what it was you was looking for in my ready event i added
// Obtain the client's application (your bot's application)
const clientApplication = await client.application?.fetch();

// Fetch permissions for a specific command
// const commandId = '1147489726245388292';
const permissions = await clientApplication?.commands.permissions.fetch({
guild: '1068285177891131422', // Guild ID where the command is registered
});

console.log(permissions);
// Obtain the client's application (your bot's application)
const clientApplication = await client.application?.fetch();

// Fetch permissions for a specific command
// const commandId = '1147489726245388292';
const permissions = await clientApplication?.commands.permissions.fetch({
guild: '1068285177891131422', // Guild ID where the command is registered
});

console.log(permissions);
logs: Collection(0) [Map] {} all commands are global
Collection(25) [Map] {
'1147489726245388291' => <ref *23> ApplicationCommand {
id: '1147489726245388291',
applicationId: '930882181595807774',
guild: null,
guildId: null,
permissions: ApplicationCommandPermissionsManager {
manager: [Circular *23],
guild: null,
guildId: null,
commandId: '1147489726245388291'
},
type: 1,
nsfw: false,
name: 'suggest',
nameLocalizations: null,
nameLocalized: null,
description: 'Suggest an improvment for the discord bot',
descriptionLocalizations: null,
descriptionLocalized: null,
options: [ [Object], [Object], [Object] ],
defaultMemberPermissions: PermissionsBitField { bitfield: 2048n },
dmPermission: true,
version: '1147489726555758700'
},
Collection(25) [Map] {
'1147489726245388291' => <ref *23> ApplicationCommand {
id: '1147489726245388291',
applicationId: '930882181595807774',
guild: null,
guildId: null,
permissions: ApplicationCommandPermissionsManager {
manager: [Circular *23],
guild: null,
guildId: null,
commandId: '1147489726245388291'
},
type: 1,
nsfw: false,
name: 'suggest',
nameLocalizations: null,
nameLocalized: null,
description: 'Suggest an improvment for the discord bot',
descriptionLocalizations: null,
descriptionLocalized: null,
options: [ [Object], [Object], [Object] ],
defaultMemberPermissions: PermissionsBitField { bitfield: 2048n },
dmPermission: true,
version: '1147489726555758700'
},
it has a full list of my commands yea its in the server and my alt has the permissions to send messages these are the scopes the bot has too scope: 'identify guilds applications.commands bot', seems my alt can use commands in my test server but not in my main server Confused yet my commands are registered globally! i figured out the issue, for some reason my channel got out of sync with the category and the channel was set to not be able to use commands but the category was set to use commands, thank you for the help