aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/hydroroll/plugins/plugin_echo/__init__.py
blob: faa47df3607bfcc6b744d28abfdb7c0baedb25bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import re

from plugins.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"))
        )