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>
38 lines
997 B
Python
38 lines
997 B
Python
"""群管理工具 —— 聊天互动(概率表情)。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import random
|
|
|
|
from nonebot import require
|
|
from nonebot.adapters.onebot.v11 import MessageEvent
|
|
from nonebot_plugin_alconna import UniMessage
|
|
from nonebot import on_keyword
|
|
|
|
from ...constants import RES_DIR
|
|
from ...utils.media import image_to_base64
|
|
|
|
require("nonebot_plugin_alconna")
|
|
|
|
|
|
chat_queshi = on_keyword({"确实", "有一说一", "u1s1", "yysy"})
|
|
|
|
|
|
@chat_queshi.handle()
|
|
async def chat_queshi_handle(ev: MessageEvent):
|
|
if random.random() < 0.05:
|
|
base64_str = image_to_base64(RES_DIR / "img" / "确实.jpg")
|
|
if base64_str:
|
|
await UniMessage.image(url=base64_str).send()
|
|
|
|
|
|
chat_neigui = on_keyword({"内鬼"})
|
|
|
|
|
|
@chat_neigui.handle()
|
|
async def chat_neigui_handle(ev: MessageEvent):
|
|
if random.random() < 0.10:
|
|
base64_str = image_to_base64(RES_DIR / "img" / "内鬼.png")
|
|
if base64_str:
|
|
await UniMessage.image(url=base64_str).send()
|