From 9cdd2326c8482ef06a13782572b4679986b7bdba Mon Sep 17 00:00:00 2001 From: with9 Date: Fri, 20 May 2022 19:31:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0pixiv=E6=90=9C=E5=9B=BE?= =?UTF-8?q?=E5=A4=9A=E5=85=B3=E9=94=AE=E8=AF=8D=E6=94=AF=E6=8C=81;?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dp=E7=AB=99=E6=90=9C=E5=9B=BE=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E5=8F=82=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/pixiv_rank_search/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/pixiv_rank_search/__init__.py b/plugins/pixiv_rank_search/__init__.py index d7cf0744..6f595643 100755 --- a/plugins/pixiv_rank_search/__init__.py +++ b/plugins/pixiv_rank_search/__init__.py @@ -44,6 +44,8 @@ usage: 搜图 樱岛麻衣 搜图 樱岛麻衣 5 搜图 樱岛麻衣 5 r18 + 搜图 樱岛麻衣#1000users 5 + 【多个关键词用#分割】 【默认为 热度排序】 【注意空格!!】【在线搜索会较慢】【数量可能不符?可能该页数量不够,也可能被R-18屏蔽】 """.strip() @@ -161,8 +163,8 @@ async def _(bot: Bot, event: MessageEvent, arg: Message = CommandArg()): info_list = None num = 10 page = 1 - if (n := len(msg)) == 1: - keyword = msg[0] + if (n := len(msg)) >= 1: + keyword = msg[0].replace("#"," ") if n > 1: if not is_number(msg[1]): await pixiv_keyword.finish("图片数量必须是数字!", at_sender=True) From 3db128785e4c90e96d2b6ff299887159703fe1e2 Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Mon, 23 May 2022 21:52:08 +0800 Subject: [PATCH 2/2] Update __init__.py --- plugins/pixiv_rank_search/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pixiv_rank_search/__init__.py b/plugins/pixiv_rank_search/__init__.py index 6f595643..bace5be7 100755 --- a/plugins/pixiv_rank_search/__init__.py +++ b/plugins/pixiv_rank_search/__init__.py @@ -163,7 +163,7 @@ async def _(bot: Bot, event: MessageEvent, arg: Message = CommandArg()): info_list = None num = 10 page = 1 - if (n := len(msg)) >= 1: + if (n := len(msg)) > 0: keyword = msg[0].replace("#"," ") if n > 1: if not is_number(msg[1]):