🔥 删除不必要的类型转换

上游修了hhh
This commit is contained in:
2024-08-06 16:35:35 +08:00
parent 8bb460fce0
commit b7cbe2b2a0
5 changed files with 11 additions and 16 deletions

View File

@@ -2,7 +2,6 @@ from hashlib import md5
from urllib.parse import urlencode from urllib.parse import urlencode
from arclet.alconna import Arg, ArgFlag from arclet.alconna import Arg, ArgFlag
from nepattern import parser # type: ignore[import-untyped]
from nonebot_plugin_alconna import Args, Subcommand from nonebot_plugin_alconna import Args, Subcommand
from nonebot_plugin_alconna.uniseg import UniMessage from nonebot_plugin_alconna.uniseg import UniMessage
from nonebot_plugin_orm import get_session from nonebot_plugin_orm import get_session
@@ -27,7 +26,7 @@ command.add(
Args( Args(
Arg( Arg(
'account', 'account',
parser(get_player), get_player,
notice='TETR.IO 用户名 / ID', notice='TETR.IO 用户名 / ID',
flags=[ArgFlag.HIDDEN], flags=[ArgFlag.HIDDEN],
) )

View File

@@ -1,5 +1,4 @@
from arclet.alconna import Arg from arclet.alconna import Arg
from nepattern import parser # type: ignore[import-untyped]
from nonebot_plugin_alconna import Option, Subcommand from nonebot_plugin_alconna import Option, Subcommand
from nonebot_plugin_alconna.uniseg import UniMessage from nonebot_plugin_alconna.uniseg import UniMessage
from nonebot_plugin_orm import async_scoped_session from nonebot_plugin_orm import async_scoped_session
@@ -19,7 +18,7 @@ command.add(
'config', 'config',
Option( Option(
'--default-template', '--default-template',
Arg('template', parser(Template), notice='模板版本'), Arg('template', Template, notice='模板版本'),
alias=['-DT', 'DefaultTemplate'], alias=['-DT', 'DefaultTemplate'],
help_text='设置默认查询模板', help_text='设置默认查询模板',
), ),

View File

@@ -5,7 +5,6 @@ from typing import TYPE_CHECKING, TypeVar
from urllib.parse import urlencode from urllib.parse import urlencode
from arclet.alconna import Arg, ArgFlag from arclet.alconna import Arg, ArgFlag
from nepattern import parser # type: ignore[import-untyped]
from nonebot import get_driver from nonebot import get_driver
from nonebot.adapters import Event from nonebot.adapters import Event
from nonebot.matcher import Matcher from nonebot.matcher import Matcher
@@ -50,20 +49,20 @@ command.add(
Args( Args(
Arg( Arg(
'target', 'target',
parser(At | Me), At | Me,
notice='@想要查询的人 / 自己', notice='@想要查询的人 / 自己',
flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL], flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL],
), ),
Arg( Arg(
'account', 'account',
parser(get_player), get_player,
notice='TETR.IO 用户名 / ID', notice='TETR.IO 用户名 / ID',
flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL], flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL],
), ),
), ),
Option( Option(
'--template', '--template',
Arg('template', parser(Template)), Arg('template', Template),
alias=['-T'], alias=['-T'],
help_text='要使用的查询模板', help_text='要使用的查询模板',
), ),

View File

@@ -1,5 +1,4 @@
from arclet.alconna import Arg, ArgFlag from arclet.alconna import Arg, ArgFlag
from nepattern import parser # type: ignore[import-untyped]
from nonebot_plugin_alconna import Args, At, Subcommand from nonebot_plugin_alconna import Args, At, Subcommand
from ...utils.exception import MessageFormatError from ...utils.exception import MessageFormatError
@@ -23,7 +22,7 @@ command.add(
Args( Args(
Arg( Arg(
'account', 'account',
parser(get_player), get_player,
notice='TOP 用户名 / ID', notice='TOP 用户名 / ID',
flags=[ArgFlag.HIDDEN], flags=[ArgFlag.HIDDEN],
) )
@@ -35,13 +34,13 @@ command.add(
Args( Args(
Arg( Arg(
'target', 'target',
parser(At | Me), At | Me,
notice='@想要查询的人 / 自己', notice='@想要查询的人 / 自己',
flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL], flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL],
), ),
Arg( Arg(
'account', 'account',
parser(get_player), get_player,
notice='TOP 用户名', notice='TOP 用户名',
flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL], flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL],
), ),

View File

@@ -1,5 +1,4 @@
from arclet.alconna import Arg, ArgFlag from arclet.alconna import Arg, ArgFlag
from nepattern import parser # type: ignore[import-untyped]
from nonebot_plugin_alconna import Args, At, Subcommand from nonebot_plugin_alconna import Args, At, Subcommand
from ...utils.exception import MessageFormatError from ...utils.exception import MessageFormatError
@@ -28,7 +27,7 @@ command.add(
Args( Args(
Arg( Arg(
'account', 'account',
parser(get_player), get_player,
notice='茶服 用户名 / ID', notice='茶服 用户名 / ID',
flags=[ArgFlag.HIDDEN], flags=[ArgFlag.HIDDEN],
) )
@@ -40,13 +39,13 @@ command.add(
Args( Args(
Arg( Arg(
'target', 'target',
parser(At | Me), At | Me,
notice='@想要查询的人 / 自己', notice='@想要查询的人 / 自己',
flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL], flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL],
), ),
Arg( Arg(
'account', 'account',
parser(get_player), get_player,
notice='茶服 用户名 / TeaID', notice='茶服 用户名 / TeaID',
flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL], flags=[ArgFlag.HIDDEN, ArgFlag.OPTIONAL],
), ),