“commands.has_role discord.py” Ответ

Discord.py Проверьте, играет ли пользователь роль

    @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

commands.has_role discord.py

from discord.ext.commands import commands
Dull Dragonfly

Ответы похожие на “commands.has_role discord.py”

Вопросы похожие на “commands.has_role discord.py”

Смотреть популярные ответы по языку

Смотреть другие языки программирования