I am writing a Discord bot that assigns a role to new users when they join my Discord guild. Let's say the role is called "Friend".
The bot is written in Python and uses the Discord.py library.
I am overwriting the on_member_join() function.
@bot.event async def on_member_join(member):
- assign member to Friend role
I see that there is a add_roles() function from the Member class, but it hasn't worked in this case because the new member doesn't have permissions to manage roles. For security concerns, the default @everyone role shouldn't have the ability to manage roles and be able to assign whatever role it wants to be.
The Discord Bot does have permissions to manage roles.
Is there a way to have the bot automatically assign a new member to the Friend role?
Thank you.