mirror of https://github.com/Mai-with-u/MaiBot.git
fix: 修复消息阻塞
parent
19d2aaed52
commit
df3a673a61
|
|
@ -48,7 +48,10 @@ class BaseMessageAPI:
|
|||
while True:
|
||||
if len(self.cache) > 0:
|
||||
for handler in self.message_handlers:
|
||||
await handler(self.cache[0])
|
||||
try:
|
||||
await handler(self.cache[0])
|
||||
except:
|
||||
pass
|
||||
self.cache.pop(0)
|
||||
if len(self.cache) > 0:
|
||||
await asyncio.sleep(0.1 / len(self.cache))
|
||||
|
|
|
|||
Loading…
Reference in New Issue