🔥 去除命令解析失败时发送提醒

This commit is contained in:
2023-11-14 12:54:42 +08:00
parent c1feccd608
commit 4c205e516f
3 changed files with 3 additions and 27 deletions

View File

@@ -3,7 +3,7 @@ from datetime import timedelta
from arclet.alconna import Alconna, Arg, ArgFlag, Args, CommandMeta, Option from arclet.alconna import Alconna, Arg, ArgFlag, Args, CommandMeta, Option
from nonebot.adapters import Bot, Event from nonebot.adapters import Bot, Event
from nonebot.matcher import Matcher from nonebot.matcher import Matcher
from nonebot_plugin_alconna import AlcMatches, At, on_alconna from nonebot_plugin_alconna import At, on_alconna
from nonebot_plugin_orm import get_session from nonebot_plugin_orm import get_session
from sqlalchemy import select from sqlalchemy import select
@@ -177,11 +177,3 @@ async def _(event: Event, matcher: Matcher, rank: Rank):
@alc.handle() @alc.handle()
async def _(matcher: Matcher, account: MessageFormatError): async def _(matcher: Matcher, account: MessageFormatError):
await matcher.finish(str(account)) await matcher.finish(str(account))
@alc.handle()
async def _(matcher: Matcher, matches: AlcMatches):
if matches.head_matched:
await matcher.finish(
f'{matches.error_info!r}\n' if matches.error_info is not None else '' + '输入"io --help"查看帮助'
)

View File

@@ -1,7 +1,7 @@
from arclet.alconna import Alconna, Arg, ArgFlag, Args, CommandMeta, Option from arclet.alconna import Alconna, Arg, ArgFlag, Args, CommandMeta, Option
from nonebot.adapters import Bot, Event from nonebot.adapters import Bot, Event
from nonebot.matcher import Matcher from nonebot.matcher import Matcher
from nonebot_plugin_alconna import AlcMatches, At, on_alconna from nonebot_plugin_alconna import At, on_alconna
from nonebot_plugin_orm import get_session from nonebot_plugin_orm import get_session
from ...db import query_bind_info from ...db import query_bind_info
@@ -116,11 +116,3 @@ async def _(event: Event, matcher: Matcher, account: User):
@alc.handle() @alc.handle()
async def _(matcher: Matcher, account: MessageFormatError): async def _(matcher: Matcher, account: MessageFormatError):
await matcher.finish(str(account)) await matcher.finish(str(account))
@alc.handle()
async def _(matcher: Matcher, matches: AlcMatches):
if matches.head_matched:
await matcher.finish(
f'{matches.error_info!r}\n' if matches.error_info is not None else '' + '输入"top --help"查看帮助'
)

View File

@@ -1,7 +1,7 @@
from arclet.alconna import Alconna, Arg, ArgFlag, Args, CommandMeta, Option from arclet.alconna import Alconna, Arg, ArgFlag, Args, CommandMeta, Option
from nonebot.adapters import Bot, Event from nonebot.adapters import Bot, Event
from nonebot.matcher import Matcher from nonebot.matcher import Matcher
from nonebot_plugin_alconna import AlcMatches, At, on_alconna from nonebot_plugin_alconna import At, on_alconna
from nonebot_plugin_orm import get_session from nonebot_plugin_orm import get_session
from ...db import query_bind_info from ...db import query_bind_info
@@ -141,11 +141,3 @@ async def _(event: Event, matcher: Matcher, account: User):
@alc.handle() @alc.handle()
async def _(matcher: Matcher, account: MessageFormatError): async def _(matcher: Matcher, account: MessageFormatError):
await matcher.finish(str(account)) await matcher.finish(str(account))
@alc.handle()
async def _(matcher: Matcher, matches: AlcMatches):
if matches.head_matched:
await matcher.finish(
f'{matches.error_info!r}\n' if matches.error_info is not None else '' + '输入"茶服 --help"查看帮助'
)