🐛 修复事件没有正确结束的bug

This commit is contained in:
2024-01-03 09:27:26 +08:00
parent 9073bf5d0b
commit 0b07882a16
3 changed files with 12 additions and 9 deletions

View File

@@ -91,7 +91,7 @@ async def _(bot: Bot, event: Event, matcher: Matcher, account: User):
command_args=[],
)
try:
await matcher.send(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
await matcher.finish(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
except NeedCatchError as e:
await matcher.send(str(e))
raise HandleNotFinishedError from e
@@ -115,7 +115,7 @@ async def _(bot: Bot, event: Event, matcher: Matcher, target: At | Me):
command_args=[],
)
try:
await matcher.send(message + await proc.handle_query())
await matcher.finish(message + await proc.handle_query())
except NeedCatchError as e:
await matcher.send(str(e))
raise HandleNotFinishedError from e
@@ -129,7 +129,7 @@ async def _(event: Event, matcher: Matcher, account: User):
command_args=[],
)
try:
await matcher.send(await proc.handle_query())
await matcher.finish(await proc.handle_query())
except NeedCatchError as e:
await matcher.send(str(e))
raise HandleNotFinishedError from e

View File

@@ -74,7 +74,7 @@ async def _(bot: Bot, event: Event, matcher: Matcher, account: User):
command_args=[],
)
try:
await matcher.send(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
await matcher.finish(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
except NeedCatchError as e:
await matcher.send(str(e))
raise HandleNotFinishedError from e
@@ -98,7 +98,7 @@ async def _(bot: Bot, event: Event, matcher: Matcher, target: At | Me):
command_args=[],
)
try:
await matcher.send(message + await proc.handle_query())
await matcher.finish(message + await proc.handle_query())
except NeedCatchError as e:
await matcher.send(str(e))
raise HandleNotFinishedError from e
@@ -112,7 +112,7 @@ async def _(event: Event, matcher: Matcher, account: User):
command_args=[],
)
try:
await matcher.send(await proc.handle_query())
await matcher.finish(await proc.handle_query())
except NeedCatchError as e:
await matcher.send(str(e))
raise HandleNotFinishedError from e

View File

@@ -94,6 +94,7 @@ try:
command_args=[],
)
await finish_special_query(matcher, proc)
except ImportError:
pass
@@ -108,6 +109,7 @@ try:
command_args=[],
)
await finish_special_query(matcher, proc)
except ImportError:
pass
@@ -122,6 +124,7 @@ try:
command_args=[],
)
await finish_special_query(matcher, proc)
except ImportError:
pass
@@ -134,7 +137,7 @@ async def _(bot: Bot, event: Event, matcher: Matcher, account: User):
command_args=[],
)
try:
await matcher.send(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
await matcher.finish(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
except NeedCatchError as e:
await matcher.send(str(e))
raise HandleNotFinishedError from e
@@ -158,7 +161,7 @@ async def _(bot: Bot, event: Event, matcher: Matcher, target: At | Me):
command_args=[],
)
try:
await matcher.send(message + await proc.handle_query())
await matcher.finish(message + await proc.handle_query())
except NeedCatchError as e:
await matcher.send(str(e))
raise HandleNotFinishedError from e
@@ -172,7 +175,7 @@ async def _(event: Event, matcher: Matcher, account: User):
command_args=[],
)
try:
await matcher.send(await proc.handle_query())
await matcher.finish(await proc.handle_query())
except NeedCatchError as e:
await matcher.send(str(e))
raise HandleNotFinishedError from e