aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugins/alicebot_plugin_echo/__init__.py
blob: 98cfa39534713146d87c2dbcd9b00ff2f13a6aee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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"))
        )