An open API service indexing awesome lists of open source software.

https://github.com/gnuf0rce/github-helper

mirai-console 插件开发计划
https://github.com/gnuf0rce/github-helper

github mirai mirai-console qqbot

Last synced: 6 days ago
JSON representation

mirai-console 插件开发计划

Awesome Lists containing this project

README

          

# [GitHub Helper](https://github.com/gnuf0rce/github-helper)

> 基于 [Mirai Console](https://github.com/mamoe/mirai-console) 的 GitHub Notice 订阅插件

[![Release](https://img.shields.io/github/v/release/gnuf0rce/github-helper)](https://github.com/gnuf0rce/github-helper/releases)
[![Downloads](https://img.shields.io/github/downloads/gnuf0rce/github-helper/total)](https://repo1.maven.org/maven2/io/github/gnuf0rce/mirai-content-censor/)
[![MiraiForum](https://img.shields.io/badge/post-on%20MiraiForum-yellow)](https://mirai.mamoe.net/topic/554)
[![GitHub Client Test](https://github.com/gnuf0rce/github-helper/actions/workflows/test.yml/badge.svg)](https://github.com/gnuf0rce/github-helper/actions/workflows/test.yml)

**使用前应该查阅的相关文档或项目**

* [User Manual](https://github.com/mamoe/mirai/blob/dev/docs/UserManual.md)
* [Permission Command](https://github.com/mamoe/mirai/blob/dev/mirai-console/docs/BuiltInCommands.md#permissioncommand)
* [Chat Command](https://github.com/project-mirai/chat-command)

## 指令

注意: 使用前请确保可以 [在聊天环境执行指令](https://github.com/project-mirai/chat-command)
`<...>`中的是指令名,例如`/repo-issue add mamoe/mirai`
`[...]`表示参数,当`[...]`后面带`?`时表示参数可选
`{...}`表示连续的多个参数

本插件指令权限ID 格式为 `io.github.gnuf0rce.github-helper:command.*`, `*` 是指令的第一指令名
例如 `/repo-issue add mamoe/mirai` 的权限ID为 `io.github.gnuf0rce.github-helper:command.repo-issue`

`[repo]` 格式为 `{owner}/{repo}`, 举例 `mamoe/mirai`
`[contact]?`是可选的参数,会自动由当前环境填充,例如群聊填充群号,私聊填充QQ号
`[type]` 消息的格式,可选值为 `OLD`, `TEXT`, `FORWARD`

**1.3.0** 版本起,添加从 GitHub Release Latest 更新插件的功能
其配置文件位于 `config/update.dict.json`

### GitHubIssuesCommand

| 指令 | 描述 |
|:-------------------------------------|:---------|
| `/ [contact]?` | 添加订阅 |
| `/ [contact]?` | 移除订阅 |
| `/ [millis]` | 设置订阅轮询间隔 |
| `/ [type]` | 设置订阅消息格式 |
| `/ [contact]?` | 查看订阅列表 |
| `/ [type] [contact]?` | 测试订阅 |

这个指令用于获取当前用户的`issues`,所以需要有效 `token`

### GitHubRepoCommitCommand

| 指令 | 描述 |
|:-------------------------------------------------|:---------|
| `/ [repo] [contact]?` | 添加订阅 |
| `/ [repo] [contact]?` | 移除订阅 |
| `/ [repo] [millis]` | 设置订阅轮询间隔 |
| `/ [repo] [type]` | 设置订阅消息格式 |
| `/ [contact]?` | 查看订阅列表 |
| `/ [repo] [type] [contact]?` | 测试订阅 |

### GitHubRepoIssueCommand

| 指令 | 描述 |
|:------------------------------------------------|:---------|
| `/ [repo] [contact]?` | 添加订阅 |
| `/ [repo] [contact]?` | 移除订阅 |
| `/ [repo] [millis]?` | 设置订阅轮询间隔 |
| `/ [repo] [type]` | 设置订阅消息格式 |
| `/ [contact]?` | 查看订阅列表 |
| `/ [repo] [type] [contact]?` | 测试订阅 |

* since 1.5.0 在 `repo` 后可补充分支名,例如 `/repo-issue add Moyuyanli/HuYanSession:dev`

### GitHubRepoPullCommand

| 指令 | 描述 |
|:-----------------------------------------------|:---------|
| `/ [repo] [contact]?` | 添加订阅 |
| `/ [repo] [contact]?` | 移除订阅 |
| `/ [repo] [millis]?` | 设置订阅轮询间隔 |
| `/ [repo] [type]` | 设置订阅消息格式 |
| `/ [contact]?` | 查看订阅列表 |
| `/ [repo] [type] [contact]?` | 测试订阅 |

### GitHubRepoReleaseCommand

| 指令 | 描述 |
|:--------------------------------------------------|:---------|
| `/ [repo] [contact]?` | 添加订阅 |
| `/ [repo] [contact]?` | 移除订阅 |
| `/ [repo] [millis]?` | 设置订阅轮询间隔 |
| `/ [repo] [type]` | 设置订阅消息格式 |
| `/ [contact]?` | 查看订阅列表 |
| `/ [repo] [type] [contact]?` | 测试订阅 |

### GitHubStatsCommand

| 指令 | 描述 |
|:---------------------------------|:-----|
| `/ [name]` | 查看状态 |
| `/ [name]` | 查看贡献 |
| `/ [name]` | 查看奖杯 |

### GitHubUpdateCommand

| 指令 | 描述 |
|:------------|:-------|
| `/` | 检查插件更新 |

## 自动通过加群问题放行开发者

`1.1.7` 起对接到 [mirai-administrator](https://github.com/cssxsh/mirai-administrator) 实现此功能

举例:

```text
问题:GitHub ID ?
答案:cssxsh
```

机器人会检查 的活跃度是否满足要求,如满足要求则放行

## 设置

### GithubConfig

* `proxy` Format http://127.0.0.1:8080 or socks://127.0.0.1:1080
* `doh` Dns Over Https Url
* `github_token` [Personal Access Tokens](https://github.com/settings/tokens)
* `reply_type` URL解析回复的消息格式
* `timeout` Http 访问超时时间,单位秒
* `percentage_member_join` 加群放行 GitHub 活跃等级(百分制),默认0,不开启功能
* `percentages` 加群放行 GitHub 活跃等级(百分制),默认0,不开启功能
* `sign_member_join` 加群放行提示信息
* `github_readme_stats` stats card 绘制参数
* `auto_update` 启动时检查插件更新

## 安装

### MCL 指令安装

**请确认 mcl.jar 的版本是 2.1.0+**
`./mcl --update-package io.github.gnuf0rce:github-helper --channel maven-stable --type plugins`

### 手动安装

1. 从 [Releases](https://github.com/gnuf0rce/github-helper/releases) 或者 [Maven](https://repo1.maven.org/maven2/io/github/gnuf0rce/mirai-content-censor/) 下载 `mirai2.jar`
2. 将其放入 `plugins` 文件夹中