推荐使用 uv 管理本项目。
若已安装 uv 则可跳过该过程。
# Linux/macOS
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"- 在仓库根目录创建
.env.prod(模板在.env.example) - 运行
uv sync配置好虚拟环境; - 运行
uv run nb run; - Bot 工作!
- 轮询 OpenJWC 服务器,获取最新资讯并群发;
- 多种群指令轻松获取资讯:
/status确认 Bot 是否存活;/check <标签名>查找对应标签中 OpenJWC 存储的最新资讯;/search <搜索内容>调用 OpenJWC Api,语义化搜索资讯。
-
Q: 初次运行 Bot,出现如下错误:
nonebot_plugin_orm.exception.AutogenerateDiffsDetected: 检测到新的升级操作: [('add_table', Table('fetch_news_pushed_notice', MetaData(), Column('id', String(), table=<fetch_news_pushed_notice>, primary_key=True, nullable=False), Column('label', String(), table=<fetch_news_pushed_notice>, nullable=False), Column('title', String(), table=<fetch_news_pushed_notice>, nullable=False), Column('date', String(), table=<fetch_news_pushed_notice>, nullable=False), Column('detail_url', String(), table=<fetch_news_pushed_notice>, nullable=False), Column('is_page', Boolean(), table=<fetch_news_pushed_notice>, nullable=False), Column('content_text', String(), table=<fetch_news_pushed_notice>), Column('attachment_urls', JSON(), table=<fetch_news_pushed_notice>), schema=None)), ('add_index', Index('ix_fetch_news_pushed_notice_date', Column('date', String(), table=<fetch_news_pushed_notice>, nullable=False))), ('add_index', Index('ix_fetch_news_pushed_notice_label', Column('label', String(), table=<fetch_news_pushed_notice>, nullable=False))), ('add_index', Index('ix_fetch_news_pushed_notice_title', Column('title', String(), table=<fetch_news_pushed_notice>, nullable=False)))]A: 使用
uv run nb orm sync初始化数据库。 -
Q: 机器人后端怎么配置?
A: 推荐 NapCat。请参阅 NapCat 的文档。配置好后端之后,记得修改.env.prod中的对应配置。 -
Q: 为什么有些群没办法定时推送通知?
A: 定时推送通知功能需要 Bot 是群管理。
MIT License