“comandos.has_role discord.py” Código de respuesta

discord.py verifique si el usuario tiene rol

    @bot.command(pass_context=True)
    @commands.has_role("Admin")
    async def unmute(ctx, user: discord.Member):
        role = discord.utils.find(lambda r: r.name == 'Member', ctx.message.server.roles)
        if role in user.roles:
            await bot.say("{} is not muted".format(user))
        else:
            await bot.add_roles(user, role)
Stupid Sandpiper

comandos.has_role discord.py

from discord.ext.commands import commands
Dull Dragonfly

Respuestas similares a “comandos.has_role discord.py”

Preguntas similares a “comandos.has_role discord.py”

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código