bot doesn’t want to add roles

Its Member.add_roles() not Bot.add_roles()

Below is the revised code:

@client.command(pass_context=True)
@commands.has_role("🍿║Участники")
async def поздравить(ctx, *, text=None):
    role = discord.utils.find(lambda r: r.id == 774543492806475816, ctx.message.guild.roles)
    if role in ctx.author.roles:
        already=discord.Embed(title=':clipboard:!поздравить:clipboard:', colour = discord.Colour.orange(), description=f'**:x:{ctx.author.mention}, вы уже поздравляли Shadow:3**')
        await ctx.send(embed=already)
        await ctx.message.delete()
        return
    else:
        success1=discord.Embed(title=':green_book:Спасибо за поздравление!:green_book:', description=f':white_check_mark:**{ctx.author.mention}, спасибо за поздравление! Оно отправлено Shadow и вы получаете {role.mention}!**\n\n***:milky_way:Текст поздравления:*** {text}', colour=discord.Colour.green())
        await ctx.send(embed=success1)
        user=ctx.message.author
        await user.add_roles(role)
        await ctx.message.delete()

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top