Are those checks enough to avoid a "missing permission" error?

I'm making a command that sets up a mute role, and it seems like I incurred in errors in a few channels. Are those checks enough to ensure that the bot filters only channel where it can edit permission overwrites?
const channels = interaction.guild.channels.cache.filter(c=>c.viewable
&& c.permissionsFor(interaction.guild.members.me).has(PermissionFlagsBits.ManageRoles)
)
const channels = interaction.guild.channels.cache.filter(c=>c.viewable
&& c.permissionsFor(interaction.guild.members.me).has(PermissionFlagsBits.ManageRoles)
)
2 Replies
d.js toolkit
d.js toolkit14mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
MoonlightCapital
MoonlightCapital14mo ago
discord.js@14.9.0 hmm, a lot more, so if i'm denying
{
SendMessages: false,
AddReactions: false,
Speak: false,
CreatePrivateThreads: false,
CreatePublicThreads: false,
SendMessagesInThreads: false,
UseApplicationCommands: false,
}
{
SendMessages: false,
AddReactions: false,
Speak: false,
CreatePrivateThreads: false,
CreatePublicThreads: false,
SendMessagesInThreads: false,
UseApplicationCommands: false,
}
i need to check all of them?