From 54cb1a17756fc230a60870c643817f78a41c6451 Mon Sep 17 00:00:00 2001 From: RF-Tar-Railt <3165388245@qq.com> Date: Sat, 10 Feb 2024 18:31:34 +0800 Subject: [PATCH] :bookmark: version 1.7.43 --- CHANGELOG.md | 6 +++++- tests/core_test.py | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 121c14b3..6142b1db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,11 @@ # 更新日志 ## Alconna 1.7.43 -### 修复 + +### 改进 +- 允许快捷指令的关键词传入带有分隔符的命令 + +### 修复 - 修复快捷指令使用 `_` 时的异常错误 ## Alconna 1.7.42 diff --git a/tests/core_test.py b/tests/core_test.py index e6d7f68f..c5b9cd74 100644 --- a/tests/core_test.py +++ b/tests/core_test.py @@ -512,6 +512,14 @@ def wrapper(slot, content): alc16_7.shortcut("test 123", {"args": ["abc"]}) assert alc16_7.parse("test 123").bar == "abc" + alc16_8 = Alconna("core16_8", Args["bar", str]) + res11 = alc16_8.parse("core16_8 1234") + assert res11.bar == "1234" + alc16_8.parse("core16_8 --shortcut test _") + res12 = alc16_8.parse("test") + assert res12.bar == "1234" + + def test_help(): from arclet.alconna import output_manager from arclet.alconna.exceptions import SpecialOptionTriggered