我正在用 Python 编写一个用于discord 的机器人。我希望当有人登录到服务器时,他被赋予一定的角色
\n\nimport discord\nfrom discord.ext import commands\nfrom discord.ext.commands import bot\nbot = commands.Bot(command_prefix=\'!\')\nfrom discord.utils import get\n\n@bot.event\nasync def on_member_join(member):\n role = get(member.roles, name="\xd0\x98\xd0\xb3\xd1\x80\xd0\xbe\xd0\xba\xd0\xb8")\n await bot.add_roles(member, role)\nRun Code Online (Sandbox Code Playgroud)\n\n当我启动并且有人进入服务器时,出现以下错误:\nAttributeError: \'Bot\' object has no attribute \'add_roles\'
\n