Answer the question
In order to leave comments, you need to log in
Discord.py, how to auto-issue roles?
Good morning everyone! I'm just getting acquainted with discord.py and I don't know how to make the bot automatically issue a role when someone enters my server. Thanks in advance!
If there is such an opportunity, then it is desirable that the execution be from
Answer the question
In order to leave comments, you need to log in
> on_member_join(member)
<
@Bot.event
async def on_member_join(member):
if role := member.guild.get_role(418187634689139935):
await member.add_roles(role)
@Bot.event #
async EVENT def on_member_join(memner): # SERVER LOGIN EVENT
role = discord.utils.get(member.guild.roles, name='Role name') # THE ROLE I'M GIVING
await member.add_roles( role) # ADD ROLE
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question