diff options
| author | 2023-04-19 01:23:44 +0800 | |
|---|---|---|
| committer | 2023-04-19 01:23:44 +0800 | |
| commit | 23b32b900423ae8fe36a50224f0308cb3d97d4d0 (patch) | |
| tree | b5a59158f31d7aed0e3d65b0cb1563e7e5ff7edc /ChienDice/plugins/iamai_plugin_echo/__init__.py | |
| parent | a69a07edfedf5e15d8013fb639ed6574e0078988 (diff) | |
| download | HydroRoll-23b32b900423ae8fe36a50224f0308cb3d97d4d0.tar.gz HydroRoll-23b32b900423ae8fe36a50224f0308cb3d97d4d0.zip | |
🏷bump
Diffstat (limited to 'ChienDice/plugins/iamai_plugin_echo/__init__.py')
| -rw-r--r-- | ChienDice/plugins/iamai_plugin_echo/__init__.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ChienDice/plugins/iamai_plugin_echo/__init__.py b/ChienDice/plugins/iamai_plugin_echo/__init__.py new file mode 100644 index 0000000..98cfa39 --- /dev/null +++ b/ChienDice/plugins/iamai_plugin_echo/__init__.py @@ -0,0 +1,17 @@ +import re + +from plugins.iamai_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")) + ) |
