Skip to content

OpenJWC/openjwc-qqbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openjwc-qqbot

快速上手

推荐使用 uv 管理本项目。

安装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"

运行程序

  1. 在仓库根目录创建 .env.prod (模板在 .env.example
  2. 运行 uv sync 配置好虚拟环境;
  3. 运行 uv run nb run
  4. Bot 工作!

功能

  1. 轮询 OpenJWC 服务器,获取最新资讯并群发;
  2. 多种群指令轻松获取资讯:
    • /status 确认 Bot 是否存活;
    • /check <标签名> 查找对应标签中 OpenJWC 存储的最新资讯;
    • /search <搜索内容> 调用 OpenJWC Api,语义化搜索资讯。

FAQ

  1. 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 初始化数据库。

  2. Q: 机器人后端怎么配置?
    A: 推荐 NapCat。请参阅 NapCat 的文档。配置好后端之后,记得修改 .env.prod 中的对应配置。

  3. Q: 为什么有些群没办法定时推送通知?
    A: 定时推送通知功能需要 Bot 是群管理。

开源

MIT License

About

基于 OpenJWC 后端的 QQBot,用于定时向QQ群里发送教务处通知

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages