mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
✨ 增加 GitHub 搜索返回图片
This commit is contained in:
parent
444a5c7bef
commit
f780325928
@ -70,6 +70,7 @@
|
|||||||
- [x] 卖萌[@xxx]
|
- [x] 卖萌[@xxx]
|
||||||
- GitHub仓库搜索 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/github"`
|
- GitHub仓库搜索 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/github"`
|
||||||
- [x] >github [xxx]
|
- [x] >github [xxx]
|
||||||
|
- [x] >github -p [xxx]
|
||||||
- 在线代码运行 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/runcode"`
|
- 在线代码运行 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/runcode"`
|
||||||
- [x] >runcode help
|
- [x] >runcode help
|
||||||
- [x] >runcode [on/off]
|
- [x] >runcode [on/off]
|
||||||
|
|||||||
@ -37,7 +37,7 @@ func init() { // 插件主体
|
|||||||
repo := info.Get("items.0")
|
repo := info.Get("items.0")
|
||||||
// 发送结果
|
// 发送结果
|
||||||
switch ctx.State["regex_matched"].([]string)[1] {
|
switch ctx.State["regex_matched"].([]string)[1] {
|
||||||
case "-pic ": // 图片模式
|
case "-p ": // 图片模式
|
||||||
ctx.SendChain(message.Image(
|
ctx.SendChain(message.Image(
|
||||||
"https://opengraph.githubassets.com/0/"+repo.Get("full_name").Str,
|
"https://opengraph.githubassets.com/0/"+repo.Get("full_name").Str,
|
||||||
).Add("cache", 0))
|
).Add("cache", 0))
|
||||||
|
|||||||
5
main.go
5
main.go
@ -39,7 +39,7 @@ func main() {
|
|||||||
fmt.Print(`
|
fmt.Print(`
|
||||||
====================[ZeroBot-Plugin]====================
|
====================[ZeroBot-Plugin]====================
|
||||||
* OneBot + ZeroBot + Golang
|
* 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
|
* Copyright © 2021 Kanri, DawnNights, All Rights Reserved
|
||||||
* Project: https://github.com/Yiwen-Chan/ZeroBot-Plugin
|
* Project: https://github.com/Yiwen-Chan/ZeroBot-Plugin
|
||||||
========================================================
|
========================================================
|
||||||
@ -57,11 +57,10 @@ func main() {
|
|||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
ctx.SendChain(message.Text(
|
ctx.SendChain(message.Text(
|
||||||
"* OneBot + ZeroBot + Golang ", "\n",
|
"* 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",
|
"* Copyright © 2021 Kanri, DawnNights, All Rights Reserved ", "\n",
|
||||||
"* Project: https://github.com/Yiwen-Chan/ZeroBot-Plugin",
|
"* Project: https://github.com/Yiwen-Chan/ZeroBot-Plugin",
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
select {}
|
select {}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user