diff options
| author | 2024-02-26 13:21:50 +0800 | |
|---|---|---|
| committer | 2024-02-26 13:21:50 +0800 | |
| commit | e6e9453a024dff943ea52b4fb588f2cf7fec509b (patch) | |
| tree | 966fb87d7f01d3c916ef3fe66ec14897ec3b0069 /example/plugins/r.py | |
| parent | 3eb819d7c48020df35336e141c38ab4d9926c21e (diff) | |
| download | HydroRoll-e6e9453a024dff943ea52b4fb588f2cf7fec509b.tar.gz HydroRoll-e6e9453a024dff943ea52b4fb588f2cf7fec509b.zip | |
refactor(command): 命令词法解析器 (#82)
* 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>
Diffstat (limited to 'example/plugins/r.py')
| -rw-r--r-- | example/plugins/r.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/example/plugins/r.py b/example/plugins/r.py deleted file mode 100644 index b2248a4..0000000 --- a/example/plugins/r.py +++ /dev/null @@ -1,23 +0,0 @@ -from iamai import Plugin -from numpy.random import Generator -from iamai.adapter.onebot11.message import CQHTTPMessage, CQHTTPMessageSegment -from iamai.log import logger - -ms = CQHTTPMessageSegment - - -class R(Plugin): - priority = 1 - - async def handle(self) -> None: - try: - await self.event.reply("test") - except Exception as e: - # await self.event.reply(f"ERROR!{e!r}") - logger.info("ERROR with message: {}".format(e)) - - async def rule(self) -> bool: - return ( - self.event.type == "message" - and self.event.message.get_plain_text().startswith(".show") - ) |
