Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

adding roles discord py

# If you need this in a bot command
@discord.ext.commands.command()
async def online(ctx):
  	guild_id = ctx.guild.id # the guild id where the command has been called
    role = discord.utils.get(bot.get_guild(guild_id).roles, id ="""The Id of the role you search""")
    await member.add_roles(role) # The role gets added to a given Member 
Source by w3programmers.org #
 
PREVIOUS NEXT
Tagged: #adding #roles #discord #py
ADD COMMENT
Topic
Name
5+9 =