From e6e9453a024dff943ea52b4fb588f2cf7fec509b Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Mon, 26 Feb 2024 13:21:50 +0800 Subject: refactor(command): 命令词法解析器 (#82) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(command): 重构命令路由 * feat(lua): 包装异步方法`self.event.reply` => `msg:echo` * feat(lua): 包装异步输入流方法`self.event.ask` => `msg:ask` * 'Refactored by Sourcery' (#83) Co-authored-by: Sourcery AI <> * feat(Token|Lexer): 添加`Token`与`Lexer`类 * refactor(Lexer): 词法分析器添加`advance`方法 * chore: lint code * refactor: sync gensokyo adapter * feat: Cli parser (#85) * feat(cli): 添加`Cli`类,解析命令行参数 * fix: 修复错误的`dest`与`action` * feat(cli): 实现`install_package` 与 `build_template` * feat(cli): 实现`-c|--config`指令配置镜像常量等 * feat(cli): 使用高效率的异步网络库`aiohttp` * fix(cli): `TYPE_CHECKING` with partially module `typing` * refactor!: examples, tests, src... rewrite in rust --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- example/plugins/_bradge-kook-cqhttp.py | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 example/plugins/_bradge-kook-cqhttp.py (limited to 'example/plugins/_bradge-kook-cqhttp.py') diff --git a/example/plugins/_bradge-kook-cqhttp.py b/example/plugins/_bradge-kook-cqhttp.py deleted file mode 100644 index 4b2712d..0000000 --- a/example/plugins/_bradge-kook-cqhttp.py +++ /dev/null @@ -1,25 +0,0 @@ -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 -- cgit v1.2.3-70-g09d2