diff options
Diffstat (limited to 'ChienDice/plugins/iamai_plugin_base')
| -rw-r--r-- | ChienDice/plugins/iamai_plugin_base/__init__.py | 2 | ||||
| -rw-r--r-- | ChienDice/plugins/iamai_plugin_base/config.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ChienDice/plugins/iamai_plugin_base/__init__.py b/ChienDice/plugins/iamai_plugin_base/__init__.py index e99ce15..fe0cd32 100644 --- a/ChienDice/plugins/iamai_plugin_base/__init__.py +++ b/ChienDice/plugins/iamai_plugin_base/__init__.py @@ -70,7 +70,7 @@ class CommandPluginBase(RegexPluginBase[T_State, T_CommandPluginConfig], ABC): def str_match(self, msg_str: str) -> bool: if not hasattr(self, "command_re_pattern"): self.command_re_pattern = re.compile( - f'({"|".join(self.config.command_prefix)})' + f'[{"".join(self.config.command_prefix)}]' f'({"|".join(self.config.command)})' r"\s*(?P<command_args>.*)", flags=re.I if self.config.ignore_case else 0, diff --git a/ChienDice/plugins/iamai_plugin_base/config.py b/ChienDice/plugins/iamai_plugin_base/config.py index b410888..c36d03e 100644 --- a/ChienDice/plugins/iamai_plugin_base/config.py +++ b/ChienDice/plugins/iamai_plugin_base/config.py @@ -5,7 +5,7 @@ from iamai import ConfigModel class BasePluginConfig(ConfigModel): __config_name__ = "" - handle_all_message: bool = False + handle_all_message: bool = True """是否处理所有类型的消息,此配置为 True 时会覆盖 handle_friend_message 和 handle_group_message。""" handle_friend_message: bool = True """是否处理好友消息。""" @@ -22,7 +22,7 @@ class RegexPluginConfig(BasePluginConfig): class CommandPluginConfig(RegexPluginConfig): - command_prefix: Set[str] = {".", "。"} + command_prefix: Set[str] = {".", "。","!"} """命令前缀。""" command: Set[str] = {} """命令文本。""" |
