From 6b060d18c23c2297a8819a37cd6738299deae616 Mon Sep 17 00:00:00 2001 From: Tarrailt Date: Wed, 7 Feb 2024 17:18:47 +0000 Subject: [PATCH] :bug: version 1.7.43 fix shortcut command _ --- .gitignore | 1 + CHANGELOG.md | 4 ++++ src/arclet/alconna/__init__.py | 2 +- src/arclet/alconna/core.py | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b6e47617..6c2be583 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,4 @@ dmypy.json # Pyre type checker .pyre/ +.pdm-python \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f7f76ac..121c14b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # 更新日志 +## Alconna 1.7.43 +### 修复 +- 修复快捷指令使用 `_` 时的异常错误 + ## Alconna 1.7.42 ### 改进 diff --git a/src/arclet/alconna/__init__.py b/src/arclet/alconna/__init__.py index d6ccacaf..9bea1ac4 100644 --- a/src/arclet/alconna/__init__.py +++ b/src/arclet/alconna/__init__.py @@ -50,7 +50,7 @@ from .typing import UnpackVar as UnpackVar from .typing import Up as Up -__version__ = "1.7.42" +__version__ = "1.7.43" # backward compatibility Arpamar = Arparma diff --git a/src/arclet/alconna/core.py b/src/arclet/alconna/core.py index 60ae08d8..30aa7916 100644 --- a/src/arclet/alconna/core.py +++ b/src/arclet/alconna/core.py @@ -296,7 +296,7 @@ def shortcut(self, key: str, args: ShortcutArgs | None = None, delete: bool = Fa return command_manager.add_shortcut(self, key, args) elif cmd := command_manager.recent_message: alc = command_manager.last_using - if alc and alc == self: + if alc and alc == self.path: return command_manager.add_shortcut(self, key, {"command": cmd}) # type: ignore raise ValueError( lang.require("shortcut", "recent_command_error").format(