Files
HeXi/hexi/plugins/nonebot_plugin_picfinder_take/__init__.py
T
sansenhoshiandClaude 9371a28e35 refactor: restructure plugins per MTSS standard, consolidate assets to res/
Per docs/plugin-audit-report.md (plugins normalized to
Trigger(handlers) → Service(services) → Model(repository/models) + utils):

- Split monolithic __init__.py into handlers/services/utils across
  dailywife, deer_pipe, dice, galgame_card, helldivers_tools,
  huoziyinshua, learning_chat, makeaquote, mc_server_status,
  ncm_saying, picfinder_take, picstatus, random_jm_code, regif,
  steam_info, video_analysis, group_tools
- Move static assets under res/: deer_pipe font/img, makeaquote font,
  helldivers img/templates, huoziyinshua HuoZiYinShua
- Add config.py + register_config_items to ncm_saying, random_jm_code,
  group_tools; learning_chat unified config bridge
- Remove deprecated: voice_trans plugin, bf_bot/test.py, dead code in
  dailywife/deer_pipe, empty dirs, debug scripts under helldivers temp
- Disable brash_general_supercredits_tools (stub comment only)
- bot.py: optional stdout/stderr redirect to log file for Web log viewer,
  force ANSI colorize on non-TTY sinks
- Move runtime data (jm_code.json) out of plugin dir into hexi/data
- Docs: plugin-audit-report.md; README reflects removed plugins

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-03 00:44:38 +08:00

40 lines
1.6 KiB
Python

"""搜图 —— 入口(元数据 + 配置注册)。"""
from nonebot import require
from nonebot.plugin import PluginMetadata
require("nonebot_plugin_alconna")
__plugin_meta__ = PluginMetadata(
name="搜图",
description="SauceNAO + ascii2d 二次元搜图",
usage=(
"(xx为bot名称)\n"
"[@bot+图片] 单张/多张搜图\n"
"[xx搜图] 进入批量搜图模式\n"
"[谢谢xx] 退出批量搜图模式"
),
type="application",
)
# 统一配置标准:把「插件内部常量」也暴露给 Web 管理台(来源无关)。
from hexi.config_standard import register_config_items # noqa: E402
from . import config as _cfgmod # noqa: E402
register_config_items(
__name__,
[
{"key": "SAUCENAO_KEY", "label": "SauceNAO API Key", "type": "password", "secret": True},
{"key": "DAILY_LIMIT", "label": "每日搜图限额", "type": "int", "default": 50},
{"key": "SEARCH_TIMEOUT", "label": "批量搜索超时(秒)", "type": "int", "default": 60},
{"key": "CHECK", "label": "开启截屏判定", "type": "bool", "default": True},
{"key": "THUMB_ON", "label": "启用缩略图", "type": "bool", "default": True},
{"key": "CHAIN_REPLY", "label": "合并转发回复", "type": "bool", "default": True},
{"key": "IGNORE_STAMP", "label": "批量忽略表情包", "type": "bool", "default": True},
{"key": "threshold", "label": "相似度阈值", "type": "float", "default": 70},
],
store=_cfgmod,
)
from .handlers import pic_private, picmessage, replymessage, start_finder, thanks # noqa: E402,F401