AstrBot 4.2.0__py3-none-any.whl → 4.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import os
6
6
 
7
7
  from astrbot.core.utils.astrbot_path import get_astrbot_data_path
8
8
 
9
- VERSION = "4.2.0"
9
+ VERSION = "4.2.1"
10
10
  DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db")
11
11
 
12
12
  # 默认配置
@@ -149,12 +149,6 @@ class CommandFilter(HandlerFilter):
149
149
  ]
150
150
  return self._cmpl_cmd_names
151
151
 
152
- def startswith(self, message_str: str) -> bool:
153
- for full_cmd in self.get_complete_command_names():
154
- if message_str.startswith(f"{full_cmd} ") or message_str == full_cmd:
155
- return True
156
- return False
157
-
158
152
  def equals(self, message_str: str) -> bool:
159
153
  for full_cmd in self.get_complete_command_names():
160
154
  if message_str == full_cmd:
@@ -170,7 +164,12 @@ class CommandFilter(HandlerFilter):
170
164
 
171
165
  # 检查是否以指令开头
172
166
  message_str = re.sub(r"\s+", " ", event.get_message_str().strip())
173
- if not self.startswith(message_str):
167
+ ok = False
168
+ for full_cmd in self.get_complete_command_names():
169
+ if message_str.startswith(f"{full_cmd} ") or message_str == full_cmd:
170
+ ok = True
171
+ message_str = message_str[len(full_cmd) :].strip()
172
+ if not ok:
174
173
  return False
175
174
 
176
175
  # 分割为列表
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AstrBot
3
- Version: 4.2.0
3
+ Version: 4.2.1
4
4
  Summary: 易上手的多平台 LLM 聊天机器人及开发框架
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.10
@@ -45,7 +45,7 @@ astrbot/core/agent/runners/base.py,sha256=exZS_d2BsrLz-xgeY9ZUPuXikBDUnKxO-dU3ZF
45
45
  astrbot/core/agent/runners/tool_loop_agent_runner.py,sha256=rdGgu_QUjOIO5mEDbb7Fe-WZFDqVnOzrW5_D4Th5mcI,12894
46
46
  astrbot/core/config/__init__.py,sha256=0CO_3sKtI3WOwWT0k4i6TleWq1SAWJFfB8KjnYB8Zig,172
47
47
  astrbot/core/config/astrbot_config.py,sha256=X-b3c5m4msgJrdYFH2LXic5XKY0ViuUMdNZ335zqSBw,6335
48
- astrbot/core/config/default.py,sha256=R1R1SnqDcRC4I0Oc-GW3BXJphFOms_vYo4qGHn8vavI,120910
48
+ astrbot/core/config/default.py,sha256=I07JZgNZ1ux3XDM2005DTtkGbStCYuRmbTr4mzSXmww,120910
49
49
  astrbot/core/db/__init__.py,sha256=VJlAcres5No8bI5YV0hrrumjBXknkfOevmuUW0jdBrc,8463
50
50
  astrbot/core/db/po.py,sha256=9MfQf4oEOYCUz7qnCjs4isWkGNpQKhaDVYqKIY8W-l0,7707
51
51
  astrbot/core/db/sqlite.py,sha256=x7m8QdZrENZvh41jKuXYit1Ll-0Tpx9xJTw6YIkDtkg,21277
@@ -171,7 +171,7 @@ astrbot/core/star/star_manager.py,sha256=c6s90gg3SgUIQ2UZxUUhslFPdS3jxVaVZOulvSM
171
171
  astrbot/core/star/star_tools.py,sha256=tAX49jAcGc5mFYu7FW3MrTFgAKtX-_TIE3tfeEArGx4,10863
172
172
  astrbot/core/star/updator.py,sha256=IVml0S4WGmKRl42EeDbU0bP8-7d0yfEY0X9qpshI_RA,3129
173
173
  astrbot/core/star/filter/__init__.py,sha256=xhdp6MMbBJbCHDDtBcAzWZ86DSFTPKzj8RpE2Cdb8ls,469
174
- astrbot/core/star/filter/command.py,sha256=ODUefROoldKQXgVLkAPPWuaOi0a4nYMPt4DCBNqLLRI,7302
174
+ astrbot/core/star/filter/command.py,sha256=Lw1q86O2l9J9kZAflM3z7hcGnjDORF2OOAIQJH0jt5k,7286
175
175
  astrbot/core/star/filter/command_group.py,sha256=PBvIWBji6EJejWVXppvOVRojGR8y6WfRF5qlyJ2jSRo,4981
176
176
  astrbot/core/star/filter/custom_filter.py,sha256=UPEfr-vYJR1NsLOp75A8Oa8RFkluEC3rkzbHM2ct0ek,2238
177
177
  astrbot/core/star/filter/event_message_type.py,sha256=R45Buoy9YALxnY6oanFlZMLfSZex2NAHPsl8DFSI_2Y,1162
@@ -218,8 +218,8 @@ astrbot/dashboard/routes/static_file.py,sha256=7KnNcOb1BVqSTft114LhGsDkfg69X2jHE
218
218
  astrbot/dashboard/routes/t2i.py,sha256=scp05AxoJM9cubrkSMBu1BbIWP1BMS50eFEPZ9S6WKM,8893
219
219
  astrbot/dashboard/routes/tools.py,sha256=FvWgjzImgeIGFWJM_r2tku3UTj0J5LwZXfmZJxfJWHM,13975
220
220
  astrbot/dashboard/routes/update.py,sha256=vhG6ET0GJNLTpfkKABYf3Aq5ChUCID1BvoZissWRBZg,6517
221
- astrbot-4.2.0.dist-info/METADATA,sha256=tDafhSXeax1IV5wqD5D9mOpBqsGFJe-0FxSlO0Hcdx4,11086
222
- astrbot-4.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
223
- astrbot-4.2.0.dist-info/entry_points.txt,sha256=OEF09YmhBWYuViXrvTLLpstF4ccmNwDL8r7nnFD0pfI,53
224
- astrbot-4.2.0.dist-info/licenses/LICENSE,sha256=zPfQj5Mq8-gThIiBcxETr7t8gND9bZWOjTGQAr80TQI,34500
225
- astrbot-4.2.0.dist-info/RECORD,,
221
+ astrbot-4.2.1.dist-info/METADATA,sha256=INv0kqB_UC7RM4kPRUW7K6m8oYaU8-0gNfOee9MZPuU,11086
222
+ astrbot-4.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
223
+ astrbot-4.2.1.dist-info/entry_points.txt,sha256=OEF09YmhBWYuViXrvTLLpstF4ccmNwDL8r7nnFD0pfI,53
224
+ astrbot-4.2.1.dist-info/licenses/LICENSE,sha256=zPfQj5Mq8-gThIiBcxETr7t8gND9bZWOjTGQAr80TQI,34500
225
+ astrbot-4.2.1.dist-info/RECORD,,