discord.py mention role code example
Example 1: add self role with discord bot python
@async def on_message(message):
if message.content == "give me admin"
role = discord.utils.get(server.roles, name="Admin")
await client.add_roles(message.author.id, role)
Example 2: discord.py mention user
bot.command(name='pingme', help='pings the author of the message')
async def pingme(ctx):
await ctx.send(ctx.author.mention)
Example 3: How to create role discord.py
guild = ctx.guild
await guild.create_role(name="role name")