summaryrefslogtreecommitdiff
path: root/ATRI/plugins/plugin_anime
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2020-11-07 14:49:51 +0800
committerKyomotoi <[email protected]>2020-11-07 14:49:51 +0800
commitc9074b24b98efe18096256ab680535f50691f67d (patch)
treefb912e4506e478d3d61e89b2824fc83d69eae7cd /ATRI/plugins/plugin_anime
parent85517a82b9f787ed7c3008655c8dc04d8e6f0a30 (diff)
downloadATRI-c9074b24b98efe18096256ab680535f50691f67d.tar.gz
ATRI-c9074b24b98efe18096256ab680535f50691f67d.tar.bz2
ATRI-c9074b24b98efe18096256ab680535f50691f67d.zip
[Upload]
Diffstat (limited to 'ATRI/plugins/plugin_anime')
-rw-r--r--ATRI/plugins/plugin_anime/__init__.py9
-rw-r--r--ATRI/plugins/plugin_anime/body.py3
2 files changed, 7 insertions, 5 deletions
diff --git a/ATRI/plugins/plugin_anime/__init__.py b/ATRI/plugins/plugin_anime/__init__.py
index d01b032..8e23a7a 100644
--- a/ATRI/plugins/plugin_anime/__init__.py
+++ b/ATRI/plugins/plugin_anime/__init__.py
@@ -2,7 +2,7 @@
# -*- encoding: utf-8 -*-
'''
@File : __init__.py
-@Time : 2020/10/11 14:38:14
+@Time : 2020/11/07 14:36:53
@Author : Kyomotoi
@Contact : [email protected]
@Github : https://github.com/Kyomotoi
@@ -71,7 +71,8 @@ async def _(bot: Bot, event: Event, state: dict) -> None:
img[0]))
-SaucenaoSearch_repo = on_message()
+SaucenaoSearch_repo = on_message(rule=check_banlist()
+ & check_switch(plugin_name_0))
@SaucenaoSearch_repo.handle() # type: ignore
@@ -88,7 +89,7 @@ async def _(bot: Bot, event: Event, state: dict) -> None:
repo_info = re.findall(r"CQ:reply,id=([0-9]\S+)]", msg)
msg_id = repo_info[0]
except Exception:
- logger.error(f"Get message_id ERROR!")
+ logger.error("Get message_id ERROR!")
await SaucenaoSearch_repo.finish(errorRepo('定位消息内容失败'))
return
@@ -218,7 +219,7 @@ async def _setu(bot: Bot, event: Event, state: dict) -> None:
title = i[1]
img = i[7]
- msg0 = f"setu info:\n"
+ msg0 = "setu info:\n"
msg0 += f"Title: {title}\n"
msg0 += f"Pid: {pid}\n"
msg0 += f"[CQ:image,file=file:///{compress_image(await aio_download_pics(img))}]"
diff --git a/ATRI/plugins/plugin_anime/body.py b/ATRI/plugins/plugin_anime/body.py
index a68dc48..d7dae84 100644
--- a/ATRI/plugins/plugin_anime/body.py
+++ b/ATRI/plugins/plugin_anime/body.py
@@ -17,6 +17,7 @@ from utils.utils_request import request_get
class SauceNAO:
+ """搜图请求主体"""
def __init__(self,
api_key,
output_type=2,
@@ -54,7 +55,7 @@ def resultRepo(user: str, key: str, img_url: str):
print(data)
msg0 += f'[CQ:at,qq={user}]\n'
- msg0 += f"SauceNAO INFO:\n"
+ msg0 += "SauceNAO INFO:\n"
msg0 += f"[CQ:image,file={data['header'].get('thumbnail', None)}]\n"
msg0 += f"Like:{data['header'].get('similarity', 0)}%\n"
msg0 += f"Title:{data['data'].get('title', None)}\n"