diff options
| author | 2023-04-19 17:08:33 +0800 | |
|---|---|---|
| committer | 2023-04-19 17:08:33 +0800 | |
| commit | f80e9f05b43a4883e58eaf82f2200d31ac87b23e (patch) | |
| tree | bb0fdd35c219bf67e8ece4010e23e39884262200 /ChienDice/plugins/iamai_plugin_send | |
| parent | bfac2edccf0f83caab5321587de3d7876fd52871 (diff) | |
| download | HydroRoll-f80e9f05b43a4883e58eaf82f2200d31ac87b23e.tar.gz HydroRoll-f80e9f05b43a4883e58eaf82f2200d31ac87b23e.zip | |
rename to `HydroRoll`
Diffstat (limited to 'ChienDice/plugins/iamai_plugin_send')
| -rw-r--r-- | ChienDice/plugins/iamai_plugin_send/__init__.py | 28 | ||||
| -rw-r--r-- | ChienDice/plugins/iamai_plugin_send/config.py | 15 |
2 files changed, 0 insertions, 43 deletions
diff --git a/ChienDice/plugins/iamai_plugin_send/__init__.py b/ChienDice/plugins/iamai_plugin_send/__init__.py deleted file mode 100644 index 4e4a516..0000000 --- a/ChienDice/plugins/iamai_plugin_send/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -import re - -from plugins.iamai_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/ChienDice/plugins/iamai_plugin_send/config.py b/ChienDice/plugins/iamai_plugin_send/config.py deleted file mode 100644 index 959822c..0000000 --- a/ChienDice/plugins/iamai_plugin_send/config.py +++ /dev/null @@ -1,15 +0,0 @@ -from typing import Set, Optional - -from plugins.iamai_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}" - """发送失败时回复的消息。""" |
