AttributeError: 'NoneType' 对象在我的 Python Bot 中没有属性 'send'

时间:2021-06-04 14:37:09

标签: python discord bots

我得到的确切错误是

await prisma.$transaction(
    myTable.map((obj) => {
      const dataObject = {
        ...
        birthdate: Date object, containing the date,
        ...
      };
      return prisma.myTable.create({
        data: dataObject,
      });
  })
);

我的代码如下

Ignoring exception in on_member_join
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 25, in on_member_join
    await myChannel.send(myGif)
AttributeError: 'NoneType' object has no attribute 'send'
Ignoring exception in on_member_join
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 25, in on_member_join
    await myChannel.send(myGif)
AttributeError: 'NoneType' object has no attribute 'send'

我知道我正在为通用频道复制正确的想法,我希望机器人进入,但我现在不知道我做错了什么

0 个答案:

没有答案