autorm 防止 dme 进行 io 操作时自动切换到等待 sleep 线程结束

This commit is contained in:
xtaodada 2021-07-31 00:05:10 +08:00
parent 5966bfef73
commit 28fe2fe808
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 5 additions and 1 deletions

View File

@ -71,6 +71,8 @@ async def remove_message(context):
if text.startswith("-autorm"): if text.startswith("-autorm"):
context.arguments = text.lstrip("-autorm").lstrip() context.arguments = text.lstrip("-autorm").lstrip()
await autorm(context) await autorm(context)
if text.startswith(f"-{alias_command('dme')}"):
return
await asyncio.sleep(delta) await asyncio.sleep(delta)
await context.delete() await context.delete()
return return
@ -79,6 +81,8 @@ async def remove_message(context):
if text.startswith("-autorm"): if text.startswith("-autorm"):
context.arguments = text.lstrip("-autorm").lstrip() context.arguments = text.lstrip("-autorm").lstrip()
await autorm(context) await autorm(context)
if text.startswith(f"-{alias_command('dme')}"):
return
await asyncio.sleep(delta) await asyncio.sleep(delta)
await context.delete() await context.delete()
return return

View File

@ -32,7 +32,7 @@
}, },
{ {
"name": "autorm", "name": "autorm",
"version": "1.02", "version": "1.03",
"section": "chat", "section": "chat",
"maintainer": "fruitymelon", "maintainer": "fruitymelon",
"size": "6.7 kb", "size": "6.7 kb",