feat: 允许自定义命令前缀

This commit is contained in:
RockChinQ
2024-07-28 16:01:58 +08:00
parent 68ddb3a6e1
commit 48cc3656bd
17 changed files with 35 additions and 8 deletions

View File

@@ -42,7 +42,9 @@ class Processor(stage.PipelineStage):
self.ap.logger.info(f"处理 {query.launcher_type.value}_{query.launcher_id} 的请求({query.query_id}): {message_text}")
async def generator():
if message_text.startswith('!') or message_text.startswith(''):
cmd_prefix = self.ap.command_cfg.data['command-prefix']
if any(message_text.startswith(prefix) for prefix in cmd_prefix):
async for result in self.cmd_handler.handle(query):
yield result
else: