【发布时间】:2020-09-12 09:48:42
【问题描述】:
我正在写这篇文章,当有新成员加入时,它会在特定公会的特定频道中发送消息:
@bot.event
async def on_member_join(member):
channel = get(member.server.channels, id=464298877823221763)
await c.send(channel,"welcome")
当有新成员加入时,我遇到了奇怪的错误:
Ignoring exception in on_member_join
Traceback (most recent call last):
File "C:\Python38\lib\site-packages\discord\client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "d:/Documents/Bots/DS BOT/self_bot.py", line 53, in on_member_join
channel = get(member.server.channels, id=464298877823221763)
AttributeError: 'Member' object has no attribute 'serve
有谁知道如何解决这个错误?
【问题讨论】:
标签: python python-3.x discord discord.py discord.py-rewrite