DEV Community

Cover image for Permission Error - Discord.js

Posted on


Permission Error - Discord.js

DiscordAPIError[50013]: Missing Permissions

Hello guys, what's up? this is my first post in this community πŸ˜ƒ, but i'm with a trouble and i find this site, i'm with a little problem about "permissions" of my discord bot, i gave Administrator permission for bot, but every time when i finish the request to give role with a interactive button, he return this error:

Image description

I'm using a instance of client class of Discord.js like this:

 getClient() {
        const client: any = new Client({ intents: GatewayIntentBits.Guilds });
        client.commands = new Collection();
        client.commandArray = [];
        return client
Enter fullscreen mode Exit fullscreen mode

But the problem is happening in this line:

const guild = client.guilds.cache.get("1032496332306403409");
                const member = guild.members.cache.get(
Enter fullscreen mode Exit fullscreen mode

I tried to change role of bot, or re-invite for the server with ALL cargos and with all scopes, not is happening...

If anyone have another better way to change the role of a person or make this line works, i will feel very hapiness 😁

Top comments (1)

thomasbnt profile image
Thomas Bnt

Hello, maybe you don't have the right Intents πŸ€”

Let's team up together 🀝

We're hiring for a Senior Full Stack Engineer to join the DEV team. Want the deets? Head here to learn more about who we're looking for.