Skip to main content

A plugin for nonebot & onebot to notify group members of new commits, issues, and PRs in GitHub repos.

Project description

logo

✨ NoneBot GitHub Release Notifier ✨

license pypi python wakatime

本插件用于监控 GitHub 仓库发布并发送通知。

本项目为纯GitHub REST API实现,非webhook,不依赖相关服务

其他语言 | Other languages: English

📖 介绍

本插件可以监控多个 GitHub 仓库,通过 QQ Bot 通知用户新动态,并支持自定义通知格式。

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行,输入以下指令即可安装:
nb plugin install nonebot-plugin-github-release-notifier
使用包管理器安装 在 nonebot2 项目的插件目录下,打开命令行,根据你使用的包管理器,输入相应的安装命令:
pip
pip install nonebot-plugin-github-release-notifier

打开 nonebot2 项目根目录下的 pyproject.toml 文件,在 [tool.nonebot] 部分追加写入:

plugins = ["nonebot-plugin-github-release-notifier"]

⚙️ 配置

使用前请确保 nonebot2 的 SUPERUSERS 配置项已配置。

在 nonebot2 项目的 .env 文件中添加下表中的必填配置:

配置项 必填 默认值 说明
GITHUB_TOKEN 空字符串 用于访问 GitHub API 的 Token
GITHUB_RETRIES 3 刷新最大重试次数
GITHUB_RETRY_DELAY 5 每次刷新重试之间的延迟(秒)
GITHUB_LANGUAGE "en_us" 发送的模板语言
GITHUB_SEND_FALIURE_GROUP True 失败时是否通知群聊
GITHUB_SEND_FALIURE_SUPERUSER False 失败时是否通知超级用户
GITHUB_DEFAULT_CONFIG_SETTING True 添加仓库时默认监控所有事件
GITHUB_SEND_IN_MARKDOWN False 是否以 Markdown 图片方式发送消息
GITHUB_SEND_DETAIL_IN_MARKDOWN True 是否以 Markdown 图片方式发送详细信息(pr/issue/release)
GITHUB_UPLOAD_REMOVE_OLDER_VER True 上传 release 文件时是否移除旧版本( in development)
GITHUB_THEME "dark" (针对issue/pull request comment)渲染页面风格 ["light","dark"]

v0.1.9 删除了对于.env添加群组repo的适配, 请使用指令使用相关功能

v0.1.10 删除了使用自定义模板输出格式,请使用github_language配置相关模板

🎉 使用

指令表

本插件所有非仅管理员或SUPERUSEES指令均设有15s Cooldown

私聊使用command请将配置群号放在指令最后,如/repo.add <user>/<repo> <group_id>

指令 权限 需要@ 范围 说明
/add_group_repo 或 /repo.add SUPERUSERS 或管理员 私聊&群聊 添加群组仓库映射
/del_group_repo 或 /repo.delete 或 /repo.del SUPERUSERS 或管理员 私聊&群聊 删除群组仓库映射
/change_group_repo_cfg 或 /repo.config 或 /repo.cfg SUPERUSERS 或管理员 私聊&群聊 修改仓库配置(支持布尔型和字符串型配置,详见下方说明)
/show_group_repo 或 /repo.show SUPERUSERS 或管理员 私聊&群聊 查看群组仓库映射
/refresh_group_repo 或 /repo.refresh SUPERUSERS 或管理员 私聊&群聊 刷新 GitHub 状态
/repo_info 或 /repo.info 所有人 私聊&群聊 查看仓库详细信息
/check_api_usage 所有人 私聊&群聊 查看 GitHub API 使用情况

TODOS

  • 自定义发送信息格式
  • 添加help
  • 数据库结构重置
  • markdown 信息支持
  • markdown 转图片展示
  • issue/pr 详细信息支持
  • 转发issue/pr comments
  • 渲染gh页面展示pr/issue

LICENCE

本插件按照MIT协议传播,相关LICENCE见此处

Releases

v0.1.10 添加issue comment转发支持,使用cscs181/QQ-GitHub-Bot渲染新页面

v0.1.9 删除了对于.env添加群组repo, 请使用指令使用相关功能

v0.1.8 已知问题修复,readme更新

v0.1.3-v0.1.7 bug修复,发布至nonebot

V0.1.2 修改发布信息

V0.1.0-V0.1.1 主程序完成,功能适配, 准备发布


免责申明(叠甲(bushi))

插件部分代码来自/启发自 cscs181/QQ-GitHub-Bot,以MIT协议传播,详细可见 此处

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file nonebot_plugin_github_release_notifier-0.1.11.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_github_release_notifier-0.1.11.tar.gz
Algorithm Hash digest
SHA256 46afffaeda1e9bf80fa37af72d1a1320aee4f03bc0752d72ef6e36b5bf3378ce
MD5 badd1c9800b968fe969f53c50f16bac4
BLAKE2b-256 2a522a21ebc5e20c66aed143b8cc70cc286d14c39bf1bbe1bcbf2d5dfe680ff1

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_github_release_notifier-0.1.11.tar.gz:

Publisher: python-publish.yml on HTony03/nonebot_plugin_github_release_notifier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonebot_plugin_github_release_notifier-0.1.11-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_github_release_notifier-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 800fa85c9da772588c9a4dbb334c2751e0c31133beebc58cf548d9e29837df23
MD5 efb39043cc377d77985c51beba6b5de2
BLAKE2b-256 34220528b463740a5f336b9c3232695d435248c33d4d07ddc1c734e956da6ed2

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_github_release_notifier-0.1.11-py3-none-any.whl:

Publisher: python-publish.yml on HTony03/nonebot_plugin_github_release_notifier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page