So lately i've noticed checking permissions just fails and breaks code . I really want to keep this in my code to prevent unneeded api calls
if (!role.editable) {
throw new Error("Not enough permissions to manage default role.");
} else {
return member.roles.add(role);
}
and
if (!interaction.channel.permissionsFor(interaction.guild.me).has(Permissions.FLAGS.MANAGE_MESSAGES)) {
return interaction.editReply({ content: xyz })
}
seem to either return a nullpointer or falsepositive. Any reason? I do try to fetch
if (!interaction.guild) await InteractionController.interaction.guild.fetch();
if (!interaction.member) await InteractionController.interaction.member.fetch();
if (!interaction.channel) await InteractionController.interaction.channel.fetch();