Discord.js v13 needs guildId in permissions
See original GitHub issueDescribe the bug Since Discord.js V13 all permissions needs a guildId whatever it’s a global or a guild slash command
To Reproduce Steps to reproduce the behavior:
- Install last Discord.js version > 13.0
- Write a new permission on your discord config
- Nothing more
Expected behavior An error should occur in the nestjs console
Screenshots
*Stacktrace
/srv/discord.limit-gif/node_modules/discord.js/src/managers/ApplicationCommandPermissionsManager.js:377
if (!guildId) throw new Error('GLOBAL_COMMAND_PERMISSIONS');
^
Error [GLOBAL_COMMAND_PERMISSIONS]: Permissions for global commands may only be fetched or modified by providing a GuildResolvable or from a guild's application command manager.
at ApplicationCommandPermissionsManager._validateOptions (/srv/discord.limit-gif/node_modules/discord.js/src/managers/ApplicationCommandPermissionsManager.js:377:25)
at ApplicationCommandPermissionsManager.set (/srv/discord.limit-gif/node_modules/discord.js/src/managers/ApplicationCommandPermissionsManager.js:162:41)
at RegisterCommandService.<anonymous> (/srv/discord.limit-gif/node_modules/@discord-nestjs/core/src/services/register-command.service.ts:236:37)
at Generator.next (<anonymous>)
at /srv/discord.limit-gif/node_modules/@discord-nestjs/core/dist/services/register-command.service.js:20:71
at new Promise (<anonymous>)
at __awaiter (/srv/discord.limit-gif/node_modules/@discord-nestjs/core/dist/services/register-command.service.js:16:12)
at /srv/discord.limit-gif/node_modules/@discord-nestjs/core/src/services/register-command.service.ts:230:53
at Array.map (<anonymous>)
at RegisterCommandService.<anonymous> (/srv/discord.limit-gif/node_modules/@discord-nestjs/core/src/services/register-command.service.ts:229:32)
Environment
- OS: Ubuntu 20.04.4 LTS
- Discord.js: ^13.6.0
- @discord-nestjs/core: ^3.1.0
- @discord-nestjs/common: ^3.1.0
Additional context
Adding an mandatory guildId Type string containing the guildId on Interface SlashCommandPermissions
and sending it to discord.js
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Permissions - discord.js Guide
Permissions. Permissions are Discord's primary feature, enabling users to customize their server's workings to their liking.
Read more >Permissions - Discord Developer Portal — Documentation
Permissions are a way to limit and grant certain abilities to users in Discord. A set of base permissions can be configured at...
Read more >403 Error when setting application command permissions on ...
Discord has released Permissions V2 to all guilds yesterday (April ... const guildId = "GUILD_ID" const url = `https://discord.com/api/v9/ ...
Read more >discordjs-bot-guide/roles.md at master - GitHub
The bot requires MANAGE_ROLES permissions for this. You can check for it using the code further down this page. Because of global rate...
Read more >Discord Slash Command Permissions - Discord.js v14
Support the Channel:Become a Member: https://www.youtube.com/ansonthedeveloper/joinBecome a Patreon: http://patreon.com/stuyyBuy me a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So after a few more researches i’ve finally understood why permissions by command ain’t working anymore Here’s the Discord.js post :
Thanks for the replies, I’m closing this issue ! 💯
Everything seems to be working now