mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 05:30:07 +08:00
✏️ 统一风格
This commit is contained in:
parent
5ea7de3c13
commit
e060f8557e
29
README.md
29
README.md
@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
### 功能
|
||||
- 群管
|
||||
- 群管 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/manager"`
|
||||
- [x] 禁言[@xxx][分钟]
|
||||
- [x] 解除禁言[@xxx]
|
||||
- [x] 我要自闭 [分钟]
|
||||
@ -38,15 +38,26 @@
|
||||
- [ ] 撤回[@xxx] [xxx]
|
||||
- [ ] 警告[@xxx]
|
||||
- [x] run[xxx]
|
||||
- 涩图
|
||||
- [x] 来份[涩图/二次元/风景]
|
||||
- [x] 添加[涩图/二次元/风景][P站图片ID]
|
||||
- [x] 删除[涩图/二次元/风景][P站图片ID]
|
||||
- [x] setu -s
|
||||
- [x] setu -x
|
||||
- [x] setu -p
|
||||
- 点歌
|
||||
- 涩图 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/setutime"`
|
||||
- [x] 搜索图片[P站图片ID]
|
||||
- [x] 搜索图片[图片]
|
||||
- [x] 来份[涩图/二次元/风景/车万]
|
||||
- [x] 添加[涩图/二次元/风景/车万][P站图片ID]
|
||||
- [x] 删除[涩图/二次元/风景/车万][P站图片ID]
|
||||
- [x] >setu status
|
||||
- [x] >setu xml
|
||||
- [x] >setu pic
|
||||
- 点歌 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/music"`
|
||||
- [x] 点歌[xxx]
|
||||
- [x] 网易点歌[xxx]
|
||||
- [x] 酷我点歌[xxx]
|
||||
- [x] 酷狗点歌[xxx]
|
||||
- GitHub仓库搜索 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/github"`
|
||||
- [x] >github [xxx]
|
||||
- 在线代码运行 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/runcode"`
|
||||
- [x] >runcode help
|
||||
- [x] >runcode [on/off]
|
||||
- [x] >runcode [language] [code block]
|
||||
- TODO...
|
||||
|
||||
### 使用方法
|
||||
|
||||
17
main.go
17
main.go
@ -7,6 +7,7 @@ import (
|
||||
easy "github.com/t-tomalak/logrus-easy-formatter"
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
"github.com/wdvxdr1123/ZeroBot/driver"
|
||||
"github.com/wdvxdr1123/ZeroBot/message"
|
||||
|
||||
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/chat"
|
||||
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/github"
|
||||
@ -25,13 +26,12 @@ func init() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Printf(`
|
||||
====================[ZeroBot-Plugin]====================
|
||||
var declare = `====================[ZeroBot-Plugin]====================
|
||||
* OneBot + ZeroBot + Golang
|
||||
* Copyright © 2020-2021 Kanri, All Rights Reserved
|
||||
* Copyright © 2021 Kanri, DawnNights, All Rights Reserved
|
||||
* Project: https://github.com/Yiwen-Chan/ZeroBot-Plugin
|
||||
========================================================
|
||||
`)
|
||||
========================================================`
|
||||
fmt.Println(declare) // 启动打印
|
||||
zero.Run(zero.Config{
|
||||
NickName: []string{"椛椛"},
|
||||
CommandPrefix: "/",
|
||||
@ -40,5 +40,12 @@ func main() {
|
||||
driver.NewWebSocketClient("127.0.0.1", "6700", ""),
|
||||
},
|
||||
})
|
||||
// 帮助
|
||||
zero.OnFullMatchGroup([]string{"/help", ".help", "菜单", "帮助"}, zero.OnlyToMe).SetBlock(true).SetPriority(999).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
ctx.SendChain(
|
||||
message.Text(declare),
|
||||
)
|
||||
})
|
||||
select {}
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ func init() { // 插件主体
|
||||
})
|
||||
|
||||
// 查询数据库涩图数量
|
||||
zero.OnFullMatchGroup([]string{"setu -s", "setu --status"}).SetBlock(true).SetPriority(23).
|
||||
zero.OnFullMatchGroup([]string{"setu -s", "setu --status", ">setu status"}).SetBlock(true).SetPriority(23).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
state := []string{"[SetuTime]"}
|
||||
for i := range PoolList {
|
||||
@ -160,14 +160,14 @@ func init() { // 插件主体
|
||||
return
|
||||
})
|
||||
// 开xml模式
|
||||
zero.OnFullMatchGroup([]string{"setu -x", "setu --xml"}).SetBlock(true).SetPriority(24).
|
||||
zero.OnFullMatchGroup([]string{"setu -x", "setu --xml", ">setu xml"}).SetBlock(true).SetPriority(24).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
FORM = "XML"
|
||||
ctx.Send("[SetuTime] XML->ON")
|
||||
return
|
||||
})
|
||||
// 关xml模式
|
||||
zero.OnFullMatchGroup([]string{"setu -p", "setu --pic"}).SetBlock(true).SetPriority(24).
|
||||
zero.OnFullMatchGroup([]string{"setu -p", "setu --pic", ">setu pic"}).SetBlock(true).SetPriority(24).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
FORM = "PIC"
|
||||
ctx.Send("[SetuTime] XML->OFF")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user