【发布时间】:2020-03-21 23:12:21
【问题描述】:
我正在用 Python 编写一个不和谐的机器人。我希望当有人登录到服务器时,他被赋予了特定的角色
import discord
from discord.ext import commands
from discord.ext.commands import bot
bot = commands.Bot(command_prefix='!')
from discord.utils import get
@bot.event
async def on_member_join(member):
role = get(member.roles, name="Игроки")
await bot.add_roles(member, role)
当我启动并且有人进入服务器时,我收到以下错误: AttributeError: 'Bot' 对象没有属性 'add_roles'
【问题讨论】:
标签: python discord discord.py