mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
🐛 修复 AlconnaMatcher 对 Alconna 的引用变成弱引用导致的问题
This commit is contained in:
@@ -9,15 +9,17 @@ from nonebot_plugin_alconna import AlcMatches, Alconna, At, CommandMeta, on_alco
|
|||||||
from .. import ns
|
from .. import ns
|
||||||
from ..utils.exception import MessageFormatError, NeedCatchError
|
from ..utils.exception import MessageFormatError, NeedCatchError
|
||||||
|
|
||||||
alc = on_alconna(
|
command: Alconna = Alconna(
|
||||||
Alconna(
|
['tetris-stats', 'tstats'],
|
||||||
['tetris-stats', 'tstats'],
|
namespace=ns,
|
||||||
namespace=ns,
|
meta=CommandMeta(
|
||||||
meta=CommandMeta(
|
description='俄罗斯方块相关游戏数据查询',
|
||||||
description='俄罗斯方块相关游戏数据查询',
|
fuzzy_match=True,
|
||||||
fuzzy_match=True,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
alc = on_alconna(
|
||||||
|
command=command,
|
||||||
skip_for_unmatch=False,
|
skip_for_unmatch=False,
|
||||||
auto_send_output=True,
|
auto_send_output=True,
|
||||||
use_origin=True,
|
use_origin=True,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from nonebot_plugin_alconna import At
|
|||||||
|
|
||||||
from ...utils.exception import MessageFormatError
|
from ...utils.exception import MessageFormatError
|
||||||
from ...utils.typing import Me
|
from ...utils.typing import Me
|
||||||
from .. import add_block_handlers, alc
|
from .. import add_block_handlers, alc, command
|
||||||
from .api import Player
|
from .api import Player
|
||||||
from .api.typing import ValidRank
|
from .api.typing import ValidRank
|
||||||
from .constant import USER_ID, USER_NAME
|
from .constant import USER_ID, USER_NAME
|
||||||
@@ -18,7 +18,7 @@ def get_player(user_id_or_name: str) -> Player | MessageFormatError:
|
|||||||
return MessageFormatError('用户名/ID不合法')
|
return MessageFormatError('用户名/ID不合法')
|
||||||
|
|
||||||
|
|
||||||
alc.command.add(
|
command.add(
|
||||||
Subcommand(
|
Subcommand(
|
||||||
'TETR.IO',
|
'TETR.IO',
|
||||||
Subcommand(
|
Subcommand(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from nonebot_plugin_alconna import At
|
|||||||
|
|
||||||
from ...utils.exception import MessageFormatError
|
from ...utils.exception import MessageFormatError
|
||||||
from ...utils.typing import Me
|
from ...utils.typing import Me
|
||||||
from .. import add_block_handlers, alc
|
from .. import add_block_handlers, alc, command
|
||||||
from .api import Player
|
from .api import Player
|
||||||
from .constant import USER_NAME
|
from .constant import USER_NAME
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ def get_player(name: str) -> Player | MessageFormatError:
|
|||||||
return MessageFormatError('用户名/ID不合法')
|
return MessageFormatError('用户名/ID不合法')
|
||||||
|
|
||||||
|
|
||||||
alc.command.add(
|
command.add(
|
||||||
Subcommand(
|
Subcommand(
|
||||||
'TOP',
|
'TOP',
|
||||||
Subcommand(
|
Subcommand(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from nonebot_plugin_alconna import At
|
|||||||
|
|
||||||
from ...utils.exception import MessageFormatError
|
from ...utils.exception import MessageFormatError
|
||||||
from ...utils.typing import Me
|
from ...utils.typing import Me
|
||||||
from .. import add_block_handlers, alc
|
from .. import add_block_handlers, alc, command
|
||||||
from .api import Player
|
from .api import Player
|
||||||
from .constant import USER_NAME
|
from .constant import USER_NAME
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ def get_player(teaid_or_name: str) -> Player | MessageFormatError:
|
|||||||
return MessageFormatError('用户名/ID不合法')
|
return MessageFormatError('用户名/ID不合法')
|
||||||
|
|
||||||
|
|
||||||
alc.command.add(
|
command.add(
|
||||||
Subcommand(
|
Subcommand(
|
||||||
'TOS',
|
'TOS',
|
||||||
Subcommand(
|
Subcommand(
|
||||||
|
|||||||
Reference in New Issue
Block a user