Certain global slash commands missing for Guild Install but not for User Install

in short: for whatever reason the guild install of the bot is missing specific global slash commands, which gets fixed by doing a user install. i see no noticable patterns between the commands that do show up and those that dont, that might indicate why this is happening; no errors at all; the bot has the proper intents and permissions (i think)
No description
No description
11 Replies
d.js toolkit
d.js toolkit5w 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! - Marked as resolved by OP
emberglaze
emberglazeOP5w ago
~\crimson-one> bun -v
1.2.11
~\crimson-one> npm list discord.js
crimson-one@ C:\Users\emberglaze\crimson-one
~\crimson-one> bun -v
1.2.11
~\crimson-one> npm list discord.js
crimson-one@ C:\Users\emberglaze\crimson-one
emberglaze
emberglazeOP5w ago
src/index.ts
src/commands/banish.command.ts // shows up in a guild
src/commands/roll.command.ts // doesnt?
src/modules/commandmanager.ts
src/index.ts
src/commands/banish.command.ts // shows up in a guild
src/commands/roll.command.ts // doesnt?
src/modules/commandmanager.ts
emberglaze
emberglazeOP5w ago
this is double weird because i havent known about this until a server member reached out to me saying that for some reason a command i just ran was missing for them (the bot is in the server, but i also had it user install'ed too) they told me it appeared once they user install'ed it and i have no idea whether its my code base, discord.js, or discord's api causing this
emberglaze
emberglazeOP5w ago
full directory tree of the entire bot code base (excluding files in .gitignore)
emberglaze
emberglazeOP5w ago
update: * upgraded bun 1.2.10 -> 1.2.11 * updated discord.js 14.19.1 -> 14.19.3 issue still persists (also, re-adding the bot into the server does not help)
emberglaze
emberglazeOP5w ago
/rolluntil shows up too, its very similar to /roll
emberglaze
emberglazeOP5w ago
refreshGlobalCommands does run
No description
emberglaze
emberglazeOP5w ago
and no member/roles/channel overrides have been set for any command that does show up
Senu
Senu4w ago
you need to clean up all of your commands first and deploy it
emberglaze
emberglazeOP4w ago
that fixed it :KikuriThumbsUp: solution code (code changed since first file upload in https://canary.discord.com/channels/222078108977594368/1367982328554590209/1367983229025521704) for anyone looking:
src/deleteCommands.ts // new standalone script, run when bot is off
src/modules/CommandManager.ts // added new command deleting methods
src/deleteCommands.ts // new standalone script, run when bot is off
src/modules/CommandManager.ts // added new command deleting methods

Did you find this page helpful?