Files
DanDingNoneBot/danding_bot/plugins/danding_qqpush/config.py
Mr.Xia c01338f496 refactor(plugins): comprehensive code review - ~35 fixes across 14 plugins
Phase 1 - Plugin code review (14/14 plugins):
- Security: 3x token leak in print→logger.debug, Bearer prefix handling
- Bug: bare except→specific exceptions, HorseState type safety, sync→async
- Critical: response_model undefined, route dead code, sync blocking event loop
- Quality: 11x print()→logger, variable name shadowing, consistent logging

Phase 2 - Deep analysis:
- Fix: payout int truncation→max(1, round(amount*odds))
- Fix: room_store get_lock race condition→dict.setdefault()
- Verify: data_manager f-string SQL is safe (uses ? placeholders)

Infrastructure: review reports generated for all plugins.
2026-05-09 23:22:28 +08:00

41 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Danding_QqPush 插件配置模块"""
from pydantic import BaseModel
class Config(BaseModel):
"""插件配置"""
Token: str = ""
"""API 访问 Token用于鉴权必须在 .env 中配置 DANDING_QQPUSH_TOKEN"""
# 图片生成配置
ImageWidth: int = 800
"""生成的图片宽度(像素)"""
ImageFontSize: int = 24
"""字体大小(像素)"""
ImagePadding: int = 30
"""图片内边距(像素)"""
ImageLineSpacing: float = 1.4
"""行距倍数"""
ImageBgColor: tuple = (252, 252, 252)
"""图片背景颜色 (R, G, B)"""
ImageTextColor: tuple = (0, 0, 0)
"""文本颜色 (R, G, B)"""
# 文本处理配置
MaxTextLength: int = 2000
"""最大文本长度(字符数),超过将截断"""
# 字体路径配置
FontPaths: list = ("/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",
"/usr/share/fonts/wqy-microhei/wqy-microhei.ttc",
"/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc",
"C:/Windows/Fonts/msyh.ttc",
"C:/Windows/Fonts/simhei.ttf",)
"""字体文件路径列表"""