Compare commits

...

2 Commits

Author SHA1 Message Date
Soulter b9de2aef60 chore: bump version to 4.2.1 2025-09-27 23:36:25 +08:00
Soulter 7a47598538 fix: 修复指令无法使用的问题
fixes: #2897
2025-09-27 23:35:35 +08:00
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import os
from astrbot.core.utils.astrbot_path import get_astrbot_data_path
VERSION = "4.2.0"
VERSION = "4.2.1"
DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db")
# 默认配置
+6 -7
View File
@@ -149,12 +149,6 @@ class CommandFilter(HandlerFilter):
]
return self._cmpl_cmd_names
def startswith(self, message_str: str) -> bool:
for full_cmd in self.get_complete_command_names():
if message_str.startswith(f"{full_cmd} ") or message_str == full_cmd:
return True
return False
def equals(self, message_str: str) -> bool:
for full_cmd in self.get_complete_command_names():
if message_str == full_cmd:
@@ -170,7 +164,12 @@ class CommandFilter(HandlerFilter):
# 检查是否以指令开头
message_str = re.sub(r"\s+", " ", event.get_message_str().strip())
if not self.startswith(message_str):
ok = False
for full_cmd in self.get_complete_command_names():
if message_str.startswith(f"{full_cmd} ") or message_str == full_cmd:
ok = True
message_str = message_str[len(full_cmd) :].strip()
if not ok:
return False
# 分割为列表
+1
View File
@@ -0,0 +1 @@
# What's Changed
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "AstrBot"
version = "4.2.0"
version = "4.2.1"
description = "易上手的多平台 LLM 聊天机器人及开发框架"
readme = "README.md"
requires-python = ">=3.10"