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/_bradge-kook-cqhttp.py | |
| parent | 642a278b1e2cc11fee587b933413a30c057753c1 (diff) | |
| download | HydroRoll-85ec2f7dc55a672b07272a50f11eb86460f38671.tar.gz HydroRoll-85ec2f7dc55a672b07272a50f11eb86460f38671.zip | |
feat:all
Diffstat (limited to 'tests/plugins/_bradge-kook-cqhttp.py')
| -rw-r--r-- | tests/plugins/_bradge-kook-cqhttp.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/plugins/_bradge-kook-cqhttp.py b/tests/plugins/_bradge-kook-cqhttp.py new file mode 100644 index 0000000..4b2712d --- /dev/null +++ b/tests/plugins/_bradge-kook-cqhttp.py @@ -0,0 +1,25 @@ +from iamai import Plugin + + +class Bradge(Plugin): + async def handle(self) -> None: + if self.event.adapter.name == "kook": + await self.bot.get_adapter("cqhttp").call_api( + "send_group_msg", + group_id=971050440, + message=f"[{self.event.adapter.name} - {self.event.extra.author.username}]\n{self.event.message}" + ) + elif self.event.adapter.name == "cqhttp": + if self.event.group_id == 971050440: + await self.bot.get_adapter("kook").call_api( + api="message/create", + target_id=1661426334688259, + content=f"[{self.event.adapter.name} - {self.event.sender.nickname}]\n{self.event.message}" + ) + + async def rule(self) -> bool: + if self.event.adapter.name not in ["cqhttp","kook"]: + return False + if self.event.type not in ["message","9",9]: + return False + return True
\ No newline at end of file |
