Open RF-Tar-Railt opened 11 months ago
插件地址:https://github.com/nonebot/plugin-alconna
类似如下代码:
spic = on_command("savepic", aliases={"存图"}, priority=5) a_spic = Alconna( "/savepic", Option("-d", help_text="删除图片"), Option("-g", help_text="全局"), Option("-ac", help_text="允许相似碰撞"), Args.filename[str], meta=CommandMeta(description="保存图片,默认保存到本群"), ) @spic.handle() async def _( bot: Bot, matcher: Matcher, event: GroupMessageEvent, state: T_State, ): command = a_spic.parse(event.message.extract_plain_text())
使用该插件可改写为
a_pic Alconna( "savepic", Option("-d", help_text="删除图片"), Option("-g", help_text="全局"), Option("-ac", help_text="允许相似碰撞"), Args["filename", str], meta=CommandMeta(description="保存图片,默认保存到本群"), ) spic = on_alconna(a_pic, aliases={"存图"}, priority=5, use_cmd_start=True) @spic.handle() async def _( bot: Bot, matcher: AlconnaMatcher, event: GroupMessageEvent, state: T_State, arp: Arparma ): ...
插件地址:https://github.com/nonebot/plugin-alconna
类似如下代码:
使用该插件可改写为