Answers for "how ot make reaction roles discord.py"

0

adding roles discord py

# If you need this in a bot command
@bot.command()
async def online(ctx):
    role = discord.utils.get(bot.get_guild(ctx.guild.id).roles, id ="Role ID")
    await member.add_roles(role)
Posted by: Guest on June-24-2021
0

reaction role discord.py

@bot.command(pass_context=True)
async def giverole(ctx, user: discord.Member, role: discord.Role):
    await user.add_roles(role)
    await ctx.send(f"hey {ctx.author.name}, {user.name} has been giving a role called: {role.name}")
Posted by: Guest on November-23-2021
0

reaction role discord.py

@role.error
async def role_error(ctx, error):
  if isinstance(error, MissingPermissions):
    await ctx.send('**:x: | You do not have permission to use this command!**')
Posted by: Guest on November-23-2021
0

reaction role discord.py

roleVer = 'BOT' #role to add
user = ctx.message.author #user
role = roleVer # change the name from roleVer to role

await ctx.send("""Attempting to Verify {}""".format(user))
try:
    await user.add_roles(discord.utils.get(user.guild.roles, name=role)) #add the role
except Exception as e:
    await ctx.send('There was an error running this command ' + str(e)) #if error
else:
    await ctx.send("""Verified: {}""".format(user)) # no errors, say verified
Posted by: Guest on November-23-2021

Python Answers by Framework

Browse Popular Code Answers by Language