Client Permissions

When using the client permission tag from applyOption it always passes as true even if the bot doesnt have the permission
Solution:
Previously, obtaining permissions for new applications did not work due to this check:
if (isNullish(permissions))
if (isNullish(permissions))
Because permissions have always had the value of this.dmChannelPermissions (for new applications), in fix, I removed this check...
GitHub
framework/src/preconditions/ClientPermissions.ts at ed6d54784a79010...
Discord bot framework built on top of discord.js for advanced and amazing bots. - sapphiredev/framework
Jump to solution
12 Replies
Favna
Favna•15mo ago
Does the bot have admin permissions?
jwn
jwnOP•15mo ago
No I tested it with every permission, always passed as true
Favna
Favna•15mo ago
@Helpers
Favna
Favna•15mo ago
Oh I saw that post at the time but I find it extremely bizarre how that would be related because 1. It fixes a bug for other applications 2. I would have no idea how to change the code to not break it for old applications again Definitly open to PRs. You / @Juyyus can use Node debugging tools to analyze the steps in the JS file in node_modules
Favna
Favna•15mo ago
@Developers please review
vladdy
vladdy•15mo ago
i dont see why or how that PR fixes it 🥴 @DemonWayne can you walk me through?
Solution
ApathyWay
ApathyWay•15mo ago
Previously, obtaining permissions for new applications did not work due to this check:
if (isNullish(permissions))
if (isNullish(permissions))
Because permissions have always had the value of this.dmChannelPermissions (for new applications), in fix, I removed this check
GitHub
framework/src/preconditions/ClientPermissions.ts at ed6d54784a79010...
Discord bot framework built on top of discord.js for advanced and amazing bots. - sapphiredev/framework
vladdy
vladdy•15mo ago
fun Nice catch
vladdy
vladdy•15mo ago
can you check if theres any other preconditions doing this? <:Dog_Cheems_Pray:734013324244680734>
Favna
Favna•15mo ago
Released v.4.6.1 which includes the PR above @Juyyus @DemonWayne
Want results from more Discord servers?
Add your server