Бот не хочет выдавать роль и выдаёт ошибку в консоль:
AttributeError: 'User' object has no attribute 'add_roles'
Вот код:
@buttons.click
async def vac_b(ctx):
ch = bot.get_channel(947195652079763536)
mem = ctx.member
me = ctx.id
verif = discord.utils.get(ctx.guild.roles, id = 944610868140867616)
ms = "**Вы успешно вакцинировались, добро пожаловать на сервер**"
emb = discord.Embed(
title = '**__ВЫ ВАКЦИНИРОВАНЫ!__**',
description = f"{ms}, {mem.mention}",
color = discord.Color.red())
await ch.send(embed = emb)
await mem.add_roles(verif)
Библиотеки:
import discord
from discord.ext import commands
from discord_components import DiscordComponents, Button, ButtonStyle
from discord.ext import commands, tasks
from discord_components import *
from discord_buttons_plugin import *
from discord.ext.commands import Bot
from discord import member
from discord.utils import get
intents = discord.Intents.all()
from discord.ext import commands, tasks