增加 GitHub 搜索返回图片

This commit is contained in:
Yiwen-Chan 2021-05-02 18:52:40 +08:00
parent 2c8812f45e
commit 6e24552be8
3 changed files with 4 additions and 4 deletions

View File

@ -70,6 +70,7 @@
- [x] 卖萌[@xxx]
- GitHub仓库搜索 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/github"`
- [x] >github [xxx]
- [x] >github -p [xxx]
- 在线代码运行 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/runcode"`
- [x] >runcode help
- [x] >runcode [on/off]

View File

@ -37,7 +37,7 @@ func init() { // 插件主体
repo := info.Get("items.0")
// 发送结果
switch ctx.State["regex_matched"].([]string)[1] {
case "-pic ": // 图片模式
case "-p ": // 图片模式
ctx.SendChain(message.Image(
"https://opengraph.githubassets.com/0/"+repo.Get("full_name").Str,
).Add("cache", 0))

View File

@ -39,7 +39,7 @@ func main() {
fmt.Print(`
====================[ZeroBot-Plugin]====================
* OneBot + ZeroBot + Golang
* Version 1.0.2 - 2021-04-23 00:06:06.6531353 +0800 CST
* Version 1.0.3 - 2021-05-02 18:50:40.5489203 +0800 CST
* Copyright © 2021 Kanri, DawnNights, All Rights Reserved
* Project: https://github.com/Yiwen-Chan/ZeroBot-Plugin
========================================================
@ -57,11 +57,10 @@ func main() {
Handle(func(ctx *zero.Ctx) {
ctx.SendChain(message.Text(
"* OneBot + ZeroBot + Golang ", "\n",
"* Version 1.0.2 - 2021-04-23 00:06:06.6531353 +0800 CST", "\n",
"* Version 1.0.3 - 2021-05-02 18:50:40.5489203 +0800 CST", "\n",
"* Copyright © 2021 Kanri, DawnNights, All Rights Reserved ", "\n",
"* Project: https://github.com/Yiwen-Chan/ZeroBot-Plugin",
))
})
select {}
}