aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--HydroRoll/__init__.py4
-rw-r--r--HydroRoll/config.py124
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_bot/__init__.py30
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_bot/config.py11
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_dice/__init__.py51
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_dice/config.py13
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_echo/__init__.py17
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_echo/config.py11
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_luck/__init__.py21
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_luck/config.py15
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_send/__init__.py28
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_send/config.py15
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_system/__init__.py75
-rw-r--r--HydroRoll/plugins/HydroRoll_plugin_system/config.py11
-rw-r--r--README.md8
-rw-r--r--docs/public/.drawio/水系架构.drawio.html4
-rw-r--r--pyproject.toml10
-rw-r--r--tests/config.toml4
-rw-r--r--tests/main.py2
19 files changed, 440 insertions, 14 deletions
diff --git a/HydroRoll/__init__.py b/HydroRoll/__init__.py
new file mode 100644
index 0000000..c72c991
--- /dev/null
+++ b/HydroRoll/__init__.py
@@ -0,0 +1,4 @@
+name = "hydroroll"
+
+from hydroroll.bot import Bot
+from hydroroll.config import GlobalConfig \ No newline at end of file
diff --git a/HydroRoll/config.py b/HydroRoll/config.py
new file mode 100644
index 0000000..6739249
--- /dev/null
+++ b/HydroRoll/config.py
@@ -0,0 +1,124 @@
+import argparse
+import sys
+import platform
+from importlib.metadata import version
+from iamai import Plugin
+import os
+import pickle
+import threading
+
+
+# 创建全局 ArgumentParser 对象
+global_parser = argparse.ArgumentParser(description='hydroroll[水系] 全局命令参数')
+
+# 定义全局配置类
+class GlobalConfig:
+ _name = "hydroroll"
+ _version = "0.1.0"
+ _svn = "2"
+ _author = "简律纯"
+ _iamai_version = version('iamai')
+ _python_ver = sys.version
+ _python_ver_raw= '.'.join(map(str, platform.python_version_tuple()[:3]))
+ current_path = os.path.dirname(os.path.abspath('__file__'))
+
+ # 定义系统组件
+ class HydroSystem:
+ def __init__(self):
+ self.parser = argparse.ArgumentParser(description='hydroroll[水系].system 系统命令参数')
+ self.subparsers = self.parser.add_subparsers()
+ self.status_parser = self.subparsers.add_parser('status', aliases=['s'], help='系统状态')
+ self.reload_parser = self.subparsers.add_parser('reload', aliases=['rld'], help='重新加载系统')
+ self.restart_parser = self.subparsers.add_parser('restart', aliases=['rst'], help='重启系统')
+ self.help = '\n'.join(self.parser.format_help().replace('\r\n', '\n').replace('\r', '').split('\n')[2:-3])
+ class HydroBot:
+ def __init__(self) -> None:
+ self.parser = argparse.ArgumentParser(description="Bot命令")
+
+
+class ConfigManager:
+ def __init__(self, directory):
+ self.directory = directory
+ self.configs = {}
+ self.locks = {}
+
+ def get(self, filename, section, key, default=None):
+ if not self._check_file_exists(filename):
+ return default
+ config = self._get_config(filename)
+ if section not in config:
+ return default
+ return config[section].get(key, default)
+
+ def set(self, filename, section, key, value):
+ config = self._get_config(filename)
+ if section not in config:
+ config[section] = {}
+ config[section][key] = value
+ self._save_config(filename, config)
+
+ def delete(self, filename, section, key):
+ config = self._get_config(filename)
+ if section not in config:
+ return
+ if key not in config[section]:
+ return
+ del config[section][key]
+ self._save_config(filename, config)
+
+ def sections(self, filename):
+ if not self._check_file_exists(filename):
+ return []
+ config = self._get_config(filename)
+ return list(config.keys())
+
+ def section_items(self, filename, section):
+ if not self._check_file_exists(filename):
+ return []
+ config = self._get_config(filename)
+ if section not in config:
+ return []
+ return list(config[section].items())
+
+ def files(self):
+ return [filename for filename in os.listdir(self.directory) if filename.endswith('.dat')]
+
+ def _get_lock(self, filename):
+ if filename not in self.locks:
+ self.locks[filename] = threading.Lock()
+ return self.locks[filename]
+
+ def _get_config(self, filename):
+ with self._get_lock(filename):
+ if filename not in self.configs:
+ filepath = os.path.join(self.directory, filename)
+ if os.path.exists(filepath):
+ try:
+ with open(filepath, 'rb') as f:
+ self.configs[filename] = pickle.load(f)
+ except:
+ pass
+ if filename not in self.configs:
+ self.configs[filename] = {}
+ return self.configs[filename]
+
+ def _save_config(self, filename, config):
+ with self._get_lock(filename):
+ try:
+ filepath = os.path.join(self.directory, filename)
+ backuppath = os.path.join(self.directory, filename + '.bak')
+ lockpath = os.path.join(self.directory, filename + '.lock')
+ with open(lockpath, 'wb') as f:
+ pass
+ if os.path.exists(filepath):
+ os.replace(filepath, backuppath)
+ with open(filepath, 'wb') as f:
+ pickle.dump(config, f)
+ os.remove(backuppath)
+ os.remove(lockpath)
+ except:
+ pass
+
+ def _check_file_exists(self, filename):
+ filepath = os.path.join(self.directory, filename)
+ return os.path.exists(filepath) and filename.endswith('.dat')
diff --git a/HydroRoll/plugins/HydroRoll_plugin_bot/__init__.py b/HydroRoll/plugins/HydroRoll_plugin_bot/__init__.py
new file mode 100644
index 0000000..2b3eec8
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_bot/__init__.py
@@ -0,0 +1,30 @@
+import re
+from importlib.metadata import version
+from plugins.hydroroll_plugin_base import CommandPluginBase
+from hydroroll.config import GlobalConfig
+
+from .config import Config
+
+
+class HydroBot(CommandPluginBase[None, Config]):
+ Config = Config
+ CurrentConfig = GlobalConfig
+ priority = 0
+
+ def __post_init__(self):
+ self.re_pattern = re.compile(r"(?P<bot_info_str>.*)", flags=re.I)
+
+ def bot_info(self):
+ info_str = f'{self.CurrentConfig._name} '\
+ f'{self.CurrentConfig._version}({self.CurrentConfig._svn}) '\
+ f'by {self.CurrentConfig._author} '\
+ f'on Python {self.CurrentConfig._python_ver_raw} '\
+ f'with {" & ".join([adapter + "("+version("iamai-adapter-"+adapter) +")" for adapter in dict(self.bot.config.adapter)])} '\
+ f'for iamai({self.CurrentConfig._iamai_version})'
+
+ return info_str
+
+ async def handle(self) -> None:
+ await self.event.reply(
+ self.format_str(self.config.message_str, self.bot_info())
+ )
diff --git a/HydroRoll/plugins/HydroRoll_plugin_bot/config.py b/HydroRoll/plugins/HydroRoll_plugin_bot/config.py
new file mode 100644
index 0000000..717b7b2
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_bot/config.py
@@ -0,0 +1,11 @@
+from typing import Set
+
+from plugins.hydroroll_plugin_base import CommandPluginConfig
+
+
+class Config(CommandPluginConfig):
+ __config_name__ = "plugin_bot_info"
+ command: Set[str] = {"bot"}
+ """命令文本。"""
+ message_str: str = "{message}"
+ """最终发送消息的格式。"""
diff --git a/HydroRoll/plugins/HydroRoll_plugin_dice/__init__.py b/HydroRoll/plugins/HydroRoll_plugin_dice/__init__.py
new file mode 100644
index 0000000..2c9d2b4
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_dice/__init__.py
@@ -0,0 +1,51 @@
+import re
+import random
+
+from iamai.log import logger
+
+from plugins.hydroroll_plugin_base import CommandPluginBase
+
+from .config import Config
+
+__all__ = ["Dice"]
+
+class Dice(CommandPluginBase[None, Config]):
+ Config = Config
+
+ def __post_init__(self):
+ self.re_pattern = re.compile(
+ r"\s*(?P<dice_times>\d+)d(?P<dice_faces>\d+)([*x](?P<dice_multiply>\d+))?",
+ flags=re.I,
+ )
+
+ async def handle(self) -> None:
+ dice_times = int(self.msg_match.group("dice_times"))
+ dice_faces = int(self.msg_match.group("dice_faces"))
+ if self.msg_match.group("dice_multiply") is None:
+ dice_multiply = None
+ else:
+ dice_multiply = int(self.msg_match.group("dice_multiply"))
+
+ if dice_times > self.config.max_dice_times:
+ await self.event.reply(
+ self.format_str(self.config.exceed_max_dice_times_str)
+ )
+ return
+
+ dice = [random.randint(1, dice_faces) for _ in range(dice_times)]
+ dice_sum = sum(dice)
+ if dice_multiply is None:
+ result_str = f"{dice_times}D{dice_faces}="
+ if dice_times != 1:
+ result_str += f"{'+'.join(map(lambda x: str(x), dice))}="
+ result_str += str(dice_sum)
+ else:
+ result_str = f"{dice_times}D{dice_faces}x{dice_multiply}="
+ if dice_times != 1:
+ result_str += (
+ f"({'+'.join(map(lambda x: str(x), dice))})x{dice_multiply}="
+ )
+ result_str += f"{dice_sum}x{dice_multiply}={dice_sum * dice_multiply}"
+
+ logger.info(f"Dice Plugin: {result_str}")
+ await self.event.reply(self.format_str(self.config.message_str, result_str))
diff --git a/HydroRoll/plugins/HydroRoll_plugin_dice/config.py b/HydroRoll/plugins/HydroRoll_plugin_dice/config.py
new file mode 100644
index 0000000..4846409
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_dice/config.py
@@ -0,0 +1,13 @@
+from typing import Set
+
+from plugins.hydroroll_plugin_base import CommandPluginConfig
+
+
+class Config(CommandPluginConfig):
+ __config_name__ = "plugin_dice"
+ command: Set[str] = {"r", "roll", "dice"}
+ """命令文本。"""
+ max_dice_times: int = 1000
+ """最大单次投掷次数。"""
+ exceed_max_dice_times_str: str = "错误:超过最大投掷次数。"
+ """超过最大单次投掷次数时的提示语。"""
diff --git a/HydroRoll/plugins/HydroRoll_plugin_echo/__init__.py b/HydroRoll/plugins/HydroRoll_plugin_echo/__init__.py
new file mode 100644
index 0000000..e800384
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_echo/__init__.py
@@ -0,0 +1,17 @@
+import re
+
+from plugins.hydroroll_plugin_base import CommandPluginBase
+
+from .config import Config
+
+
+class Echo(CommandPluginBase[None, Config]):
+ Config = Config
+
+ def __post_init__(self):
+ self.re_pattern = re.compile(r"(?P<echo_str>.*)", flags=re.I)
+
+ async def handle(self) -> None:
+ await self.event.reply(
+ self.format_str(self.config.message_str, self.msg_match.group("echo_str"))
+ )
diff --git a/HydroRoll/plugins/HydroRoll_plugin_echo/config.py b/HydroRoll/plugins/HydroRoll_plugin_echo/config.py
new file mode 100644
index 0000000..030bbec
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_echo/config.py
@@ -0,0 +1,11 @@
+from typing import Set
+
+from plugins.hydroroll_plugin_base import CommandPluginConfig
+
+
+class Config(CommandPluginConfig):
+ __config_name__ = "plugin_echo"
+ command: Set[str] = {"echo"}
+ """命令文本。"""
+ message_str: str = "*{user_name} {message}"
+ """最终发送消息的格式。"""
diff --git a/HydroRoll/plugins/HydroRoll_plugin_luck/__init__.py b/HydroRoll/plugins/HydroRoll_plugin_luck/__init__.py
new file mode 100644
index 0000000..a30c964
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_luck/__init__.py
@@ -0,0 +1,21 @@
+import re
+import time
+import random
+
+from plugins.hydroroll_plugin_base import CommandPluginBase
+
+from .config import Config
+
+
+class Luck(CommandPluginBase[None, Config]):
+ Config = Config
+
+ def __post_init__(self):
+ self.re_pattern = re.compile(r".*", flags=re.I)
+
+ async def handle(self) -> None:
+ random.seed(
+ time.strftime("%Y%j", time.localtime()) + self.format_str("{user_id}")
+ )
+ lucy = random.randint(self.config.min_int, self.config.max_int)
+ await self.event.reply(self.format_str(self.config.message_str, str(lucy)))
diff --git a/HydroRoll/plugins/HydroRoll_plugin_luck/config.py b/HydroRoll/plugins/HydroRoll_plugin_luck/config.py
new file mode 100644
index 0000000..eeef14b
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_luck/config.py
@@ -0,0 +1,15 @@
+from typing import Set
+
+from plugins.hydroroll_plugin_base import CommandPluginConfig
+
+
+class Config(CommandPluginConfig):
+ __config_name__ = "plugin_luck"
+ command: Set[str] = {"luck"}
+ """命令文本。"""
+ min_int: int = 0
+ """最小随机整数。"""
+ max_int: int = 100
+ """最大随机整数。"""
+ message_str: str = "{user_name}今天的运气是: {message}"
+ """最终发送消息的格式。"""
diff --git a/HydroRoll/plugins/HydroRoll_plugin_send/__init__.py b/HydroRoll/plugins/HydroRoll_plugin_send/__init__.py
new file mode 100644
index 0000000..234e5b3
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_send/__init__.py
@@ -0,0 +1,28 @@
+import re
+
+from plugins.hydroroll_plugin_base import CommandPluginBase
+
+from .config import Config
+
+
+class Send(CommandPluginBase[None, Config]):
+ Config = Config
+
+ def __post_init__(self):
+ self.re_pattern = re.compile(r"\s*(?P<message>.*)", flags=re.I)
+
+ async def handle(self) -> None:
+ try:
+ await self.event.adapter.send(
+ self.msg_match.group("message"),
+ "private",
+ self.config.send_user_id,
+ )
+ except Exception as e:
+ if self.config.send_filed_msg is not None:
+ await self.event.reply(
+ self.format_str(self.config.send_filed_msg, repr(e))
+ )
+ else:
+ if self.config.send_success_msg is not None:
+ await self.event.reply(self.format_str(self.config.send_success_msg))
diff --git a/HydroRoll/plugins/HydroRoll_plugin_send/config.py b/HydroRoll/plugins/HydroRoll_plugin_send/config.py
new file mode 100644
index 0000000..6903c0f
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_send/config.py
@@ -0,0 +1,15 @@
+from typing import Set, Optional
+
+from plugins.hydroroll_plugin_base import CommandPluginConfig
+
+
+class Config(CommandPluginConfig):
+ __config_name__ = "plugin_send"
+ command: Set[str] = {"send"}
+ """命令文本。"""
+ send_user_id: int = 2753364619
+ """发送消息的对象的 QQ 号码。"""
+ send_success_msg: Optional[str] = "已将消息送出√"
+ """发送成功时回复的消息,设置为 None 表示不发送任何消息。"""
+ send_filed_msg: Optional[str] = "发送失败:{message}"
+ """发送失败时回复的消息。"""
diff --git a/HydroRoll/plugins/HydroRoll_plugin_system/__init__.py b/HydroRoll/plugins/HydroRoll_plugin_system/__init__.py
new file mode 100644
index 0000000..6e4f232
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_system/__init__.py
@@ -0,0 +1,75 @@
+import re
+from plugins.hydroroll_plugin_base import CommandPluginBase
+from .config import Config
+import psutil
+import time
+from hydroroll.config import GlobalConfig
+from iamai.adapter.cqhttp.message import CQHTTPMessageSegment
+
+class System(CommandPluginBase[None, Config]):
+ priority: int = 0
+ block: bool = True
+ Config = Config
+ CurrentConfig = GlobalConfig
+
+ def __post_init__(self):
+ self.re_pattern = re.compile(r"(?P<system_info_str>.*)", flags=re.I)
+
+ def eventReply(self, message: str):
+ return self.event.reply(
+ self.format_str(self.config.message_str, message)
+ )
+
+ def get_system_status(self) -> str:
+ cpu_usage = psutil.cpu_percent()
+ memory_usage = psutil.virtual_memory().percent
+ disk_usage = psutil.disk_usage('/').percent
+
+ current_time = time.time()
+ start_time = psutil.Process().create_time()
+
+ uptime_seconds = int(current_time - start_time)
+ uptime_str = time.strftime("%H:%M:%S", time.gmtime(uptime_seconds))
+
+ info_str = f"{self.CurrentConfig._name} Ver.{self.CurrentConfig._version}"
+ info_str += f"({self.CurrentConfig._svn}) built in Python {self.CurrentConfig._python_ver}\n"
+ info_str += f"本地时间: {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())}\n"
+ info_str += f"已启动时间:{uptime_str}\n"
+ info_str += f"CPU使用率:{cpu_usage}%\n"
+ info_str += f"内存占用率:{memory_usage}%\n"
+ info_str += f"磁盘使用率:{disk_usage}%"
+
+ return info_str
+
+ async def handle(self) -> None:
+ system = self.CurrentConfig.HydroSystem()
+ try:
+ sub_command = self.event.get_plain_text().split()[1]
+ except IndexError:
+ sub_command = ""
+
+ if sub_command in ["status", "s"]:
+ await self.event.reply(
+ self.format_str(self.config.message_str,
+ self.get_system_status())
+ )
+ elif sub_command in ["restart", "rst"]:
+ await self.event.reply(
+ self.format_str(self.config.message_str, "正在重启系统...")
+ )
+ self.bot.restart()
+
+ elif sub_command in ["reload", "rld"]:
+ await self.event.reply(
+ self.format_str(self.config.message_str, "正在重载...")
+ )
+ self.bot.reload_plugins()
+ await self.event.reply(
+ self.format_str(self.config.message_str,
+ f"已加载{len(self.bot.plugins)}枚插件")
+ )
+ else:
+ await self.event.reply(
+ CQHTTPMessageSegment.reply(self.event.message_id) +
+ self.format_str(self.config.message_str, system.help)
+ )
diff --git a/HydroRoll/plugins/HydroRoll_plugin_system/config.py b/HydroRoll/plugins/HydroRoll_plugin_system/config.py
new file mode 100644
index 0000000..416fcbe
--- /dev/null
+++ b/HydroRoll/plugins/HydroRoll_plugin_system/config.py
@@ -0,0 +1,11 @@
+from typing import Set
+
+from plugins.hydroroll_plugin_base import CommandPluginConfig
+
+
+class Config(CommandPluginConfig):
+ __config_name__ = "plugin_system_info"
+ command: Set[str] = {"system"}
+ """命令文本。"""
+ message_str: str = "{message}"
+ """最终发送消息的格式。"""
diff --git a/README.md b/README.md
index 1799930..03f16b1 100644
--- a/README.md
+++ b/README.md
@@ -4,18 +4,18 @@
<source media="(prefers-color-scheme: dark)" srcset="image/readme/1682620162817.png">
<img src="image/readme/1682620162817.png" height="128">
</picture>
- <h1 align="center">HydroRoll'</h1>
+ <h1 align="center">hydroroll'</h1>
</a>
</p>
<p align="center">
- <a aria-label="Vercel Site" href="https://HydroRoll.retrofor.space/">
+ <a aria-label="Vercel Site" href="https://hydroroll.retrofor.space/">
<img src="https://img.shields.io/badge/DOCS%20AND%20BLOGS-000000.svg?style=for-the-badge&logo=Vercel&labelColor=000">
</a>
- <a aria-label="PYTHON version" href="https://pypi.org/project/HydroRoll">
+ <a aria-label="PYTHON version" href="https://pypi.org/project/hydroroll">
<img alt="" src="https://img.shields.io/npm/v/turbo.svg?style=for-the-badge&labelColor=000000">
</a>
- <a aria-label="License" href="https://github.com/retrofor/HydroRoll/blob/main/LICENSE">
+ <a aria-label="License" href="https://github.com/retrofor/hydroroll/blob/main/LICENSE">
<img alt="" src="https://img.shields.io/npm/l/turbo.svg?style=for-the-badge&labelColor=000000&color=">
</a>
<a aria-label="Join the community on GitHub" href="https://github.com/vercel/turbo/discussions">
diff --git a/docs/public/.drawio/水系架构.drawio.html b/docs/public/.drawio/水系架构.drawio.html
index c0a5bc8..24034fe 100644
--- a/docs/public/.drawio/水系架构.drawio.html
+++ b/docs/public/.drawio/水系架构.drawio.html
@@ -2,11 +2,11 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>diagrams.net</title>
-<meta http-equiv="refresh" content="0;URL='https://app.diagrams.net/#Hretrofor%2FHydroRoll%2Fmain%2Fdocs%2Fpublic%2F.drawio%2F%E6%B0%B4%E7%B3%BB%E6%9E%B6%E6%9E%84.drawio.html'"/>
+<meta http-equiv="refresh" content="0;URL='https://app.diagrams.net/#Hretrofor%2Fhydroroll%2Fmain%2Fdocs%2Fpublic%2F.drawio%2F%E6%B0%B4%E7%B3%BB%E6%9E%B6%E6%9E%84.drawio.html'"/>
<meta charset="utf-8"/>
</head>
<body>
<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="{&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;nav&quot;:true,&quot;resize&quot;:true,&quot;xml&quot;:&quot;&lt;mxfile host=\&quot;app.diagrams.net\&quot; modified=\&quot;2023-04-27T18:01:02.634Z\&quot; agent=\&quot;5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48\&quot; etag=\&quot;98FMvntx2dP42k30fXe-\&quot; version=\&quot;20.4.0\&quot; type=\&quot;github\&quot;&gt;&lt;diagram name=\&quot;Page-1\&quot; id=\&quot;5f0bae14-7c28-e335-631c-24af17079c00\&quot;&gt;&lt;mxGraphModel dx=\&quot;2302\&quot; dy=\&quot;878\&quot; grid=\&quot;1\&quot; gridSize=\&quot;10\&quot; guides=\&quot;1\&quot; tooltips=\&quot;1\&quot; connect=\&quot;1\&quot; arrows=\&quot;1\&quot; fold=\&quot;1\&quot; page=\&quot;1\&quot; pageScale=\&quot;1\&quot; pageWidth=\&quot;1100\&quot; pageHeight=\&quot;850\&quot; math=\&quot;0\&quot; shadow=\&quot;0\&quot;&gt;&lt;root&gt;&lt;mxCell id=\&quot;0\&quot;/&gt;&lt;mxCell id=\&quot;1\&quot; parent=\&quot;0\&quot;/&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-74\&quot; value=\&quot;文件目录结构\&quot; style=\&quot;swimlane;sketch=1;hachureGap=4;jiggle=2;strokeColor=default;fontFamily=Helvetica;fontSize=12;\&quot; vertex=\&quot;1\&quot; parent=\&quot;1\&quot;&gt;&lt;mxGeometry x=\&quot;-790\&quot; y=\&quot;150\&quot; width=\&quot;450\&quot; height=\&quot;580\&quot; as=\&quot;geometry\&quot;&gt;&lt;mxRectangle x=\&quot;730\&quot; y=\&quot;140\&quot; width=\&quot;110\&quot; height=\&quot;30\&quot; as=\&quot;alternateBounds\&quot;/&gt;&lt;/mxGeometry&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-65\&quot; value=\&quot;logs&amp;#10;日志文件夹\&quot; style=\&quot;swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-74\&quot;&gt;&lt;mxGeometry x=\&quot;30\&quot; y=\&quot;70\&quot; width=\&quot;140\&quot; height=\&quot;60\&quot; as=\&quot;geometry\&quot;&gt;&lt;mxRectangle x=\&quot;30\&quot; y=\&quot;50\&quot; width=\&quot;100\&quot; height=\&quot;40\&quot; as=\&quot;alternateBounds\&quot;/&gt;&lt;/mxGeometry&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-66\&quot; value=\&quot;2023042800060445.txt\&quot; style=\&quot;text;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;strokeColor=none;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-65\&quot;&gt;&lt;mxGeometry y=\&quot;30\&quot; width=\&quot;140\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-30\&quot; value=\&quot;web&amp;#10;UI文件夹\&quot; style=\&quot;swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-74\&quot;&gt;&lt;mxGeometry x=\&quot;260\&quot; y=\&quot;70\&quot; width=\&quot;150\&quot; height=\&quot;90\&quot; as=\&quot;geometry\&quot;&gt;&lt;mxRectangle x=\&quot;300\&quot; y=\&quot;50\&quot; width=\&quot;100\&quot; height=\&quot;40\&quot; as=\&quot;alternateBounds\&quot;/&gt;&lt;/mxGeometry&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-61\&quot; value=\&quot;frontend&amp;lt;span style=&amp;quot;white-space: pre;&amp;quot;&amp;gt;&amp;#9;&amp;lt;/span&amp;gt;(前端文件夹)\&quot; style=\&quot;text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=12;fontFamily=Helvetica;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-30\&quot;&gt;&lt;mxGeometry y=\&quot;30\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-63\&quot; value=\&quot;backend&amp;lt;span style=&amp;quot;white-space: pre;&amp;quot;&amp;gt;&amp;#9;&amp;lt;/span&amp;gt;(后端文件夹)\&quot; style=\&quot;text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=12;fontFamily=Helvetica;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-30\&quot;&gt;&lt;mxGeometry y=\&quot;60\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-25\&quot; value=\&quot;config&amp;#10;配置文件夹\&quot; style=\&quot;swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-74\&quot;&gt;&lt;mxGeometry x=\&quot;30\&quot; y=\&quot;190\&quot; width=\&quot;140\&quot; height=\&quot;60\&quot; as=\&quot;geometry\&quot;&gt;&lt;mxRectangle x=\&quot;100\&quot; y=\&quot;250\&quot; width=\&quot;100\&quot; height=\&quot;40\&quot; as=\&quot;alternateBounds\&quot;/&gt;&lt;/mxGeometry&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-26\&quot; value=\&quot;censor.json\&quot; style=\&quot;text;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;strokeColor=none;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-25\&quot;&gt;&lt;mxGeometry y=\&quot;30\&quot; width=\&quot;140\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-20\&quot; value=\&quot;models&amp;#10;模型文件夹\&quot; style=\&quot;swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-74\&quot;&gt;&lt;mxGeometry x=\&quot;260\&quot; y=\&quot;190\&quot; width=\&quot;150\&quot; height=\&quot;150\&quot; as=\&quot;geometry\&quot;&gt;&lt;mxRectangle x=\&quot;320\&quot; y=\&quot;250\&quot; width=\&quot;100\&quot; height=\&quot;40\&quot; as=\&quot;alternateBounds\&quot;/&gt;&lt;/mxGeometry&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-21\&quot; value=\&quot;models_default.tar.gz\&quot; style=\&quot;text;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;strokeColor=default;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-20\&quot;&gt;&lt;mxGeometry y=\&quot;30\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-22\&quot; value=\&quot;models_hentai.tar.gz\&quot; style=\&quot;text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-20\&quot;&gt;&lt;mxGeometry y=\&quot;60\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-23\&quot; value=\&quot;models_servant.tar.gz\&quot; style=\&quot;text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-20\&quot;&gt;&lt;mxGeometry y=\&quot;90\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-24\&quot; value=\&quot;models_assistant.tar.gz\&quot; style=\&quot;text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;container=0;snapToPoint=0;noLabel=0;metaEdit=0;autosize=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-20\&quot;&gt;&lt;mxGeometry y=\&quot;120\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-1\&quot; value=\&quot;rules&amp;#10;规则文件夹\&quot; style=\&quot;swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-74\&quot;&gt;&lt;mxGeometry x=\&quot;30\&quot; y=\&quot;300\&quot; width=\&quot;140\&quot; height=\&quot;150\&quot; as=\&quot;geometry\&quot;&gt;&lt;mxRectangle x=\&quot;50\&quot; y=\&quot;340\&quot; width=\&quot;100\&quot; height=\&quot;40\&quot; as=\&quot;alternateBounds\&quot;/&gt;&lt;/mxGeometry&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-2\&quot; value=\&quot;rules-default\&quot; style=\&quot;text;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;strokeColor=default;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-1\&quot;&gt;&lt;mxGeometry y=\&quot;30\&quot; width=\&quot;140\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-3\&quot; value=\&quot;rules-skyfall\&quot; style=\&quot;text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-1\&quot;&gt;&lt;mxGeometry y=\&quot;60\&quot; width=\&quot;140\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-4\&quot; value=\&quot;rules-pine\&quot; style=\&quot;text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-1\&quot;&gt;&lt;mxGeometry y=\&quot;90\&quot; width=\&quot;140\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-5\&quot; value=\&quot;rules-jane\&quot; style=\&quot;text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;container=0;snapToPoint=0;noLabel=0;metaEdit=0;autosize=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-1\&quot;&gt;&lt;mxGeometry y=\&quot;120\&quot; width=\&quot;140\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-58\&quot; value=\&quot;plugins&amp;#10;插件文件夹\&quot; style=\&quot;swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-74\&quot;&gt;&lt;mxGeometry x=\&quot;260\&quot; y=\&quot;390\&quot; width=\&quot;150\&quot; height=\&quot;150\&quot; as=\&quot;geometry\&quot;&gt;&lt;mxRectangle x=\&quot;300\&quot; y=\&quot;420\&quot; width=\&quot;100\&quot; height=\&quot;40\&quot; as=\&quot;alternateBounds\&quot;/&gt;&lt;/mxGeometry&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-59\&quot; value=\&quot;plugin_1\&quot; style=\&quot;text;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;strokeColor=none;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-58\&quot;&gt;&lt;mxGeometry y=\&quot;30\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-67\&quot; value=\&quot;plugin_2\&quot; style=\&quot;text;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;strokeColor=none;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-58\&quot;&gt;&lt;mxGeometry y=\&quot;60\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-68\&quot; value=\&quot;plugin_3.py\&quot; style=\&quot;text;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;strokeColor=none;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-58\&quot;&gt;&lt;mxGeometry y=\&quot;90\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-82\&quot; value=\&quot;plugin_4.py\&quot; style=\&quot;text;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;rounded=0;strokeColor=none;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-58\&quot;&gt;&lt;mxGeometry y=\&quot;120\&quot; width=\&quot;150\&quot; height=\&quot;30\&quot; as=\&quot;geometry\&quot;/&gt;&lt;/mxCell&gt;&lt;mxCell id=\&quot;uVe3mF7CTFMHZBntQ0y6-69\&quot; value=\&quot;users&amp;#10;用户文件夹\&quot; style=\&quot;swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;sketch=1;\&quot; vertex=\&quot;1\&quot; parent=\&quot;uVe3mF7CTFMHZBntQ0y6-74\&quot;&gt;&lt;mxGeometry x=\&quot;30\&quot; y=\&quot;480\&quot; width=\&quot;140\&quot; height=\&quot;60\&quot; as=\&quot;geometry\&quot;&gt;&lt;mxRectangle x=\&quot;50\&quot; y=\&quot;490\&quot; width=\&quot;100\&quot; height=\&quot;40\&quot; as=\&quot;alternateBounds\&quot;/&gt;&lt;/mxGeometry&gt;&lt;/mxCell&gt;&lt;/root&gt;&lt;/mxGraphModel&gt;&lt;/diagram&gt;&lt;/mxfile&gt;&quot;,&quot;toolbar&quot;:&quot;pages zoom layers lightbox&quot;,&quot;page&quot;:0}"></div>
-<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="https://app.diagrams.net/#Hretrofor%2FHydroRoll%2Fmain%2Fdocs%2Fpublic%2F.drawio%2F%E6%B0%B4%E7%B3%BB%E6%9E%B6%E6%9E%84.drawio.html" target="_blank"><img border="0" src="https://app.diagrams.net/images/drawlogo128.png"/></a>
+<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="https://app.diagrams.net/#Hretrofor%2Fhydroroll%2Fmain%2Fdocs%2Fpublic%2F.drawio%2F%E6%B0%B4%E7%B3%BB%E6%9E%B6%E6%9E%84.drawio.html" target="_blank"><img border="0" src="https://app.diagrams.net/images/drawlogo128.png"/></a>
</body>
</html>
diff --git a/pyproject.toml b/pyproject.toml
index 1bc12e9..f020d47 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,13 +1,13 @@
[tool.poetry]
-name = "HydroRoll"
+name = "hydroroll"
version = "0.1.1"
description = "bot framework."
authors = ["简律纯 <admin@jyunko.cn>"]
license = "MIT"
readme = "README.md"
-homepage = "https://HydroRoll.retrofor.space/"
-repository = "https://github.com/retrofor/HydroRoll"
-documentation = "https://HydroRoll.retrofor.space/"
+homepage = "https://hydroroll.retrofor.space/"
+repository = "https://github.com/retrofor/hydroroll"
+documentation = "https://hydroroll.retrofor.space/"
keywords = ["bot", "qq", "qqbot", "mirai", "coolq"]
classifiers = [
"Development Status :: 5 - Production/Stable",
@@ -39,7 +39,7 @@ profile = "black"
length_sort = true
skip_gitignore = true
force_sort_within_sections = true
-src_paths = ["HydroRoll", "tests"]
+src_paths = ["hydroroll", "tests"]
extra_standard_library = ["typing_extensions"]
[tool.pyright]
diff --git a/tests/config.toml b/tests/config.toml
index 55d49a5..c3799b3 100644
--- a/tests/config.toml
+++ b/tests/config.toml
@@ -1,9 +1,9 @@
-[HydroRoll]
+[hydroroll]
version = "v0.1.0"
svn = "1"
author = "简律纯"
-[HydroRoll.self]
+[hydroroll.self]
header = "Hydro系[1]号"
# info = "一只水系骰子..."
diff --git a/tests/main.py b/tests/main.py
index 93f67f2..da054c4 100644
--- a/tests/main.py
+++ b/tests/main.py
@@ -1,4 +1,4 @@
-from HydroRoll import Bot
+from hydroroll import Bot
bot = Bot(hot_reload=True)