Skip to content

Commit 1bebde2

Browse files
committed
✨ 添加配置项 search_immediately ,默认启用,私聊发送图片立即搜图,否则需要先发送 搜图 命令
1 parent 8fedda0 commit 1bebde2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

YetAnotherPicSearch/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ async def _to_me(bot: Bot, event: MessageEvent) -> bool:
3232
has_image = bool([i for i in event.reply.message if i.type == "image"])
3333
else:
3434
has_image = bool([i for i in msgs if i.type == "image"])
35+
if isinstance(event, PrivateMessageEvent):
36+
return has_image and event.to_me and config.search_immediately
3537
return has_image and (event.to_me or at_me)
3638

3739

YetAnotherPicSearch/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
class Config(BaseConfig):
88

9+
search_immediately = True # 私聊发送图片立即搜图,否则需要先发送搜图命令
910
hide_img: bool = False # 隐藏所有搜索结果的缩略图
1011
saucenao_low_acc: int = 60 # saucenao 相似度低于这个百分比将被认定为相似度过低
1112
use_ascii2d_when_low_acc: bool = True # 是否在 saucenao 相似度过低时自动使用 ascii2d

0 commit comments

Comments
 (0)