summaryrefslogtreecommitdiff
path: root/ATRI/plugins/saucenao/__init__.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2021-10-01 08:56:42 +0800
committerKyomotoi <[email protected]>2021-10-01 08:56:42 +0800
commit844bd56a5bed1293329299c8b0562558a0d2d907 (patch)
tree0b121b4e85b42e9a83dd65639013215272bb6527 /ATRI/plugins/saucenao/__init__.py
parenta00308d801a0ce13f0f19f6c3984bbbe2e09f57b (diff)
downloadATRI-844bd56a5bed1293329299c8b0562558a0d2d907.tar.gz
ATRI-844bd56a5bed1293329299c8b0562558a0d2d907.tar.bz2
ATRI-844bd56a5bed1293329299c8b0562558a0d2d907.zip
🐛⚡️🔥 更新
修复: - `setu`、`saucenao`搜图时失败报错 更新: - 弃用`aiohttp`,改用`httpx` 删除: - 临时删除暂未完成的`console`
Diffstat (limited to 'ATRI/plugins/saucenao/__init__.py')
-rw-r--r--ATRI/plugins/saucenao/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ATRI/plugins/saucenao/__init__.py b/ATRI/plugins/saucenao/__init__.py
index b55f18c..d0bf606 100644
--- a/ATRI/plugins/saucenao/__init__.py
+++ b/ATRI/plugins/saucenao/__init__.py
@@ -48,7 +48,11 @@ async def _deal_search(bot: Bot, event: MessageEvent, state: T_State):
if not img:
await saucenao.reject("请发送图片而不是其他东西!!")
- a = SaouceNao(SauceNAO.key)
+ try:
+ a = SaouceNao(SauceNAO.key)
+ except Exception:
+ await saucenao.finish("失败了...")
+
result = f"> {MessageSegment.at(user_id)}" + await a.search(img[0])
_search_flmt.start_cd(user_id)
await saucenao.finish(Message(result))