Answers for "print roles of a discord server 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

bot that only responds to certain roles discord.py

if message.content.lower().startswith('/role'):
    user = message.author

    if message.channel.is_private or discord.utils.get(user.roles, name="admin") is None:
        return

    role = discord.utils.get(user.server.roles, id="437923291047526402")
    await client.add_roles(user, role)
Posted by: Guest on June-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language