From 85ec2f7dc55a672b07272a50f11eb86460f38671 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 9 Aug 2023 14:36:37 +0800 Subject: feat:all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/plugins/e.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/plugins/e.py (limited to 'tests/plugins/e.py') diff --git a/tests/plugins/e.py b/tests/plugins/e.py new file mode 100644 index 0000000..be28e30 --- /dev/null +++ b/tests/plugins/e.py @@ -0,0 +1,16 @@ +from iamai import Plugin + +class Exec(Plugin): + async def handle(self) -> None: + try: + await self.event.reply(eval(self.event.raw_message[5:])) + except Exception as e: + await self.event.reply(f"ERROR:\n\t{e}") + + async def rule(self) -> bool: + if self.event.adapter.name != "cqhttp": + return False + try: + return self.event.message.get_plain_text().startswith(".show") + except: + return False \ No newline at end of file -- cgit v1.2.3-70-g09d2