我不明白自己做错了什么,代码有效,但是停止了。代码:
@client.event
async def on_member_join( member ):
channel = client.get_channel( 722453189227577399 )
#Id lobby
role = discord.utils.get( member.guild.roles, id = 728237846565224562 )
await member.add_roles( role )
await channel.send( embed = discord.Embed( description = f'Клон ``{member.name}``, прибыл на службу!', color = 0xFFFFFF ))
跟踪:
Ignoring exception in on_member_join
Traceback (most recent call last):
File "C:\Programs\lib\site-packages\discord\client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "501.py", line 34, in on_member_join
await member.add_roles( role )
File "C:\Programs\lib\site-packages\discord\member.py", line 641, in add_roles
await req(guild_id, user_id, role.id, reason=reason)
File "C:\Programs\lib\site-packages\discord\http.py", line 221, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions