From c177a4d279b159a76d737e6b4ae547ccdd979a4e Mon Sep 17 00:00:00 2001 From: Kyomotoi <kyomotoiowo@gmail.com> Date: Thu, 26 Aug 2021 01:22:34 +0800 Subject: =?UTF-8?q?=F0=9F=90=9B=F0=9F=94=A5=20=E6=9B=B4=E6=94=B9=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复: - 好友/群邀请 写入文件失败 - 同意 好友/群邀请、查看申请列表 获取arg失败 删除: - 移除 Ubuntu paste 更改: - saucenao 最大显示数量为3 - anime search 最大显示数量为3 --- ATRI/plugins/saucenao/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'ATRI/plugins/saucenao/__init__.py') diff --git a/ATRI/plugins/saucenao/__init__.py b/ATRI/plugins/saucenao/__init__.py index b55f18c..468b001 100644 --- a/ATRI/plugins/saucenao/__init__.py +++ b/ATRI/plugins/saucenao/__init__.py @@ -16,7 +16,6 @@ _search_flmt_notice = choice(["慢...慢一..点❤", "冷静1下", "歇会歇 saucenao = SaouceNao().on_command("以图搜图", "透过一张图搜索可能的来源") - @saucenao.args_parser # type: ignore async def _get_img(bot: Bot, event: MessageEvent, state: T_State): msg = str(event.message).strip() @@ -28,18 +27,16 @@ async def _get_img(bot: Bot, event: MessageEvent, state: T_State): else: state["img"] = msg - @saucenao.handle() async def _ready_search(bot: Bot, event: MessageEvent, state: T_State): user_id = event.get_user_id() if not _search_flmt.check(user_id): await saucenao.finish(_search_flmt_notice) - + msg = str(event.message).strip() if msg: state["img"] = msg - @saucenao.got("img", "图呢?") async def _deal_search(bot: Bot, event: MessageEvent, state: T_State): user_id = event.get_user_id() @@ -47,7 +44,7 @@ async def _deal_search(bot: Bot, event: MessageEvent, state: T_State): img = findall(r"url=(.*?)]", msg) if not img: await saucenao.reject("请发送图片而不是其他东西!!") - + a = SaouceNao(SauceNAO.key) result = f"> {MessageSegment.at(user_id)}" + await a.search(img[0]) _search_flmt.start_cd(user_id) -- cgit v1.2.3