因此,我正在创建一个Discord机器人,该机器人必须将每条消息都连接到Websocket,以更新表/编辑Discord上的消息。问题是更新延迟太久了,我不知道是什么原因导致该问题,而在python上的asyncio经验不足
loop = asyncio.get_event_loop()
#... some code ...
def on_message(self, message):
# Receives the data from the websocket
loop.create_task(UpdateTable(message))
#this one gots called delayed w/c is the problem
async def UpdateTable(newOutput):
# Do some shit
await discordMessage.edit(content=newOutput)
可能是什么原因造成的?