summaryrefslogtreecommitdiff
path: root/ATRI/plugins/saucenao/__init__.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2021-08-26 01:22:34 +0800
committerKyomotoi <[email protected]>2021-08-26 01:22:34 +0800
commitc177a4d279b159a76d737e6b4ae547ccdd979a4e (patch)
treebd5001f02e92a5bff38286a4251aa2781cae4683 /ATRI/plugins/saucenao/__init__.py
parentf17b264ad6470ba1308deacb25b9ead59461c895 (diff)
downloadATRI-c177a4d279b159a76d737e6b4ae547ccdd979a4e.tar.gz
ATRI-c177a4d279b159a76d737e6b4ae547ccdd979a4e.tar.bz2
ATRI-c177a4d279b159a76d737e6b4ae547ccdd979a4e.zip
🐛🔥 更改一些内容
修复: - 好友/群邀请 写入文件失败 - 同意 好友/群邀请、查看申请列表 获取arg失败 删除: - 移除 Ubuntu paste 更改: - saucenao 最大显示数量为3 - anime search 最大显示数量为3
Diffstat (limited to 'ATRI/plugins/saucenao/__init__.py')
-rw-r--r--ATRI/plugins/saucenao/__init__.py7
1 files changed, 2 insertions, 5 deletions
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)