【发布时间】:2021-05-17 21:22:04
【问题描述】:
例如,我有一张名为“JIMR1”的卡,每 15 分钟它会从数据库表中删除一个代码。当我运行此代码时,它显示错误 can't send non-None value to a just-started coroutine 。我添加了打印,它显示代码没有任何问题,但只有当我尝试发送代码时它才会出现问题。
@commands.command()
@commands.has_permissions(administrator=True)
async def startc(self, ctx):
channel = ctx.channel.id
self.client.scheduler.add_job(self.cardDrop, CronTrigger(minute='0, 15, 30, 45'), args=[channel])
async def cardDrop(self, channel):
cards = db.column("SELECT Code FROM cardsHand")
card = random.choice(cards)
print(card)
await self.client.fetch_channel(channel).send(card)
【问题讨论】:
-
总是将完整的错误消息(从单词“Traceback”开始)作为文本(不是截图,不是链接到外部门户)有问题(不是评论)。还有其他有用的信息。
标签: python discord discord.py scheduled-tasks