diff options
| author | 2023-08-09 14:36:37 +0800 | |
|---|---|---|
| committer | 2023-08-09 14:36:37 +0800 | |
| commit | 85ec2f7dc55a672b07272a50f11eb86460f38671 (patch) | |
| tree | 8517989c8cc6444df8ae7ae50802a3b81766b01f /tests/plugins/e.py | |
| parent | 642a278b1e2cc11fee587b933413a30c057753c1 (diff) | |
| download | HydroRoll-85ec2f7dc55a672b07272a50f11eb86460f38671.tar.gz HydroRoll-85ec2f7dc55a672b07272a50f11eb86460f38671.zip | |
feat:all
Diffstat (limited to 'tests/plugins/e.py')
| -rw-r--r-- | tests/plugins/e.py | 16 |
1 files changed, 16 insertions, 0 deletions
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 |
