Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

410
Views
DiscordAPIError: Missing Access But The Bot Already Has All Permissions

I was coding a Discord bot, and everything was fine. However, when I update discord.js from 13.8.0 to 13.8.1 and try to give members role by clicking button and submit a modal, it shows this error:

/app/node_modules/discord.js/src/rest/RequestHandler.js:350
  throw new DiscordAPIError(data, res.status, request);
        ^
DiscordAPIError: Missing Access
    at RequestHandler.execute (/app/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async GuildMemberRoleManager.add (/app/node_modules/discord.js/src/managers/GuildMemberRoleManager.js:124:7)
at async /app/events/guild/modalSubmit.js:10:7 {
  method: 'put',
  path: '/guilds/926089413933539359/members/606668363531288577/roles/926252511201988678',
  code: 50001,
  httpStatus: 403,
  requestData: { json: undefined, files: [] }
}

I've checked the permissions of the bot, but it already had all permissions.

Code of the modalSubit:

const response = modal.getTextInputValue('verification-input');
if(response.toLowerCase()!=="lock"){
  await modal.reply({content:"Failed!",ephemeral: true});
  return;
}
modal.guild.roles.fetch('926252511201988678')
  .then(async role=>{
  await modal.member.roles.add(role);
})
await modal.reply({content:"Finished!",ephemeral: true});
 }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You gotta make sure your bot's highest role is above the role you're trying to add in the guild hierarchy

example role setup

about 4 years ago · Juan Pablo Isaza Report

0

Well, I think I figure it out. The bot joined a 2FA server, without a 2FA account creating it. I found this out by clicking another button which shows an error like this:

/rbd/pnpm-volume/d50c9aa3-e1b3-4f3c-a369-a5ec640ad85c/node_modules/discord.js/src/rest/RequestHandler.js:350
      throw new DiscordAPIError(data, res.status, request);
            ^
DiscordAPIError: Two factor is required for this operation
    at RequestHandler.execute (/rbd/pnpm-volume/d50c9aa3-e1b3-4f3c-a369-a5ec640ad85c/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/rbd/pnpm-volume/d50c9aa3-e1b3-4f3c-a369-a5ec640ad85c/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async GuildChannelManager.create (/rbd/pnpm-volume/d50c9aa3-e1b3-4f3c-a369-a5ec640ad85c/node_modules/discord.js/src/managers/GuildChannelManager.js:157:18)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!