Files
QQAwesomeBot/src/plugins/bili_push/config.py
T

39 lines
1.6 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.
"""bili_push B站动态推送插件配置"""
from pydantic import BaseModel, Field
class Config(BaseModel):
"""全部配置项均可在 .env 文件中覆盖"""
# 推送目标群:与夜间禁言插件共用同一个白名单(NIGHT_MUTE_GROUPS)
night_mute_groups: set[int] = Field(default_factory=set)
# 要监控的B站用户 UID,为空时不监控
bili_push_uids: set[int] = Field(default_factory=set)
# 轮询间隔(秒)
bili_push_interval: int = Field(default=300, ge=30)
# 单个用户一次轮询最多推送的动态条数(防止积压刷屏)
bili_push_batch_limit: int = Field(default=3, ge=1, le=10)
# 一条动态最多附带的图片张数,0 表示不发图
bili_push_max_images: int = Field(default=3, ge=0, le=9)
# 推送消息模板,可用变量:
# {author} UP主名字
# {action} 动作(投稿了新视频 / 发布了新动态 / 转发了一条动态 等)
# {text} 动态正文(转发动态会自动带上原动态摘要)
# {title} 视频/专栏/音频等卡片标题
# {orig_author} 转发的原动态作者
# {orig_text} 转发的原动态内容
# {link} 动态/视频链接
# {images} 图片插入位置(不写则图片追加在消息末尾)
# 换行写作 \n
bili_push_template: str = "[B站动态] {author} {action}\n\n{text}\n{images}\n{link}"
# 可选:登录B站后的完整 Cookie 字符串,
# 动态接口被风控(返回 -352)时需要配置才能拉取
bili_push_cookie: str = ""