🚨 修复 pyright 类型报错

This commit is contained in:
2024-08-06 15:27:42 +08:00
parent 214ebc5073
commit cd9d29b748
4 changed files with 16 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ from hashlib import md5
from urllib.parse import urlencode
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.uniseg import UniMessage
from nonebot_plugin_orm import get_session
@@ -27,7 +28,7 @@ command.add(
Args(
Arg(
'account',
get_player,
parser(get_player),
notice='TETR.IO 用户名 / ID',
flags=[ArgFlag.HIDDEN],
)

View File

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

View File

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

View File

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