Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

discord.py autorole

@client.event
async def on_member_join(member):
    if member.guild.name == "":  # Server Name   
        role = member.guild.get_role()#role id here
        await member.add_roles(role)
        embed = discord.Embed(title=f"Member Joined", description=f"{member.mention}, Welcome to {member.guild.name}. We hope that your time with us is a happy one!", color=0x9b26b9)

        embed.add_field(name=f'Please check out the Rules Channel!', value="Rules channel mention", inline=False)
        embed.add_field(name="Latest announcements are made here!", value="Announcment channel mention", inline=False)

        await client.get_channel(channel_id_here).send(embed=embed)

    else:
        return
 
PREVIOUS NEXT
Tagged: #autorole
ADD COMMENT
Topic
Name
5+2 =