Answer the question
In order to leave comments, you need to log in
403 Forbidden when trying to give out a role in discord.py?
I have code:
intents = discord.Intents.all()
bot = commands.Bot(command_prefix = settings['prefix'], intents=intents)
@bot.event
async def on_member_join(member):
await member.send(f"Thanks for Joining {member.guild.name}")
role = discord.utils.get(member.guild.roles, id=123456)
await member.add_roles(role)
Answer the question
In order to leave comments, you need to log in
depending on what role you want to issue.
for example, if a bot has the "Admin" role, with all rights (including administrator rights), it will not be able to:
1) give someone the Admin role, remove the Admin role from itself.
2) give someone a role that is higher in the list of roles than Admin.
only the owner of the server can manipulate absolutely all roles.
In theory, administrator rights prevent bots from interacting with people who have a higher role. Also, most likely you are trying to give a person a role that is more privileged than the role of a bot. In general, the role of a bot should be above others.
People also say that the problem can be if 2FA is enabled on the server, in which case the bot owner should also enable it
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question