Discord.py错误的欢迎/离开功能

时间:2018-07-06 16:51:07

标签: python python-3.x function discord discord.py

所以我正在为Discord机器人学习python,但是在“欢迎/离开”消息功能上遇到了问题。 自2天以来一直在寻找,但没有人帮忙,所以我在这里发布:)

整个代码在这里:

https://hastebin.com/ugerusawid.py

错误:

Ignoring exception in on_member_join
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\DC bots\chao-assistant\chao.py", line 98, in on_member_join
    await client.send_message(serverchannel, msg)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 1145, in send_message
    channel_id, guild_id = yield from self._resolve_destination(destination)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 289, in _resolve_destination
    raise InvalidArgument(fmt.format(destination))
discord.errors.InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object. Received NoneType


Ignoring exception in on_member_remove
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\DC bots\chao-assistant\chao.py", line 105, in on_member_remove
    await client.send_message(serverchannel, msg)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 1145, in send_message
    channel_id, guild_id = yield from self._resolve_destination(destination)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 289, in _resolve_destination
    raise InvalidArgument(fmt.format(destination))
discord.errors.InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object. Received NoneType

0 个答案:

没有答案