aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugins/alicebot_plugin_base/config.py
diff options
context:
space:
mode:
author简律纯 <hsiangnianian@outlook.com>2023-04-18 18:03:02 +0800
committer简律纯 <hsiangnianian@outlook.com>2023-04-18 18:03:02 +0800
commit025020c503ef5b8dc0270197c5b1e6d4e0f8807d (patch)
tree25f8c8d8882647e22ea0acebadafef99306f4c98 /plugins/alicebot_plugin_base/config.py
parent074ad0c914ae0b53ace46ed5d4c24205eacbabaa (diff)
downloadHydroRoll-025020c503ef5b8dc0270197c5b1e6d4e0f8807d.tar.gz
HydroRoll-025020c503ef5b8dc0270197c5b1e6d4e0f8807d.zip
✨本体文件
Diffstat (limited to 'plugins/alicebot_plugin_base/config.py')
-rw-r--r--plugins/alicebot_plugin_base/config.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/alicebot_plugin_base/config.py b/plugins/alicebot_plugin_base/config.py
new file mode 100644
index 0000000..24e5ecf
--- /dev/null
+++ b/plugins/alicebot_plugin_base/config.py
@@ -0,0 +1,30 @@
+from typing import Set, Optional
+
+from alicebot import ConfigModel
+
+
+class BasePluginConfig(ConfigModel):
+ __config_name__ = ""
+ handle_all_message: bool = False
+ """是否处理所有类型的消息,此配置为 True 时会覆盖 handle_friend_message 和 handle_group_message。"""
+ handle_friend_message: bool = True
+ """是否处理好友消息。"""
+ handle_group_message: bool = True
+ """是否处理群消息。"""
+ accept_group: Optional[Set[int]] = None
+ """处理消息的群号,仅当 handle_group_message 为 True 时生效,留空表示处理所有群。"""
+ message_str: str = "{user_name}: {message}"
+ """最终发送消息的格式。"""
+
+
+class RegexPluginConfig(BasePluginConfig):
+ pass
+
+
+class CommandPluginConfig(RegexPluginConfig):
+ command_prefix: Set[str] = {".", "。"}
+ """命令前缀。"""
+ command: Set[str] = {}
+ """命令文本。"""
+ ignore_case: bool = True
+ """忽略大小写。"""