【发布时间】:2021-12-24 09:40:14
【问题描述】:
所以我的问题是每当我尝试使用循环时,它都会给我一个错误,称为: await channel.send('没有人在线!') AttributeError: 'NoneType' 对象没有属性 'send'
我已经尝试在 @client.command() 上使用它并且没有问题。你能帮帮我吗?
@tasks.loop(seconds = 40)
async def t():
channel = client.get_channel(908484216084385853)
.
.
.
if len(error_list) == len(names):
await channel.send('Nobody is online!')
else:
for i in range(len(friends_list)):
await channel.send(friends_list[i].capitalize())
【问题讨论】:
标签: python discord.py