mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:20:08 +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] 解除禁言[@xxx]
|
- [x] 解除禁言[@xxx]
|
||||||
- [x] 我要自闭 [分钟]
|
- [x] 我要自闭 [分钟]
|
||||||
@ -38,15 +38,26 @@
|
|||||||
- [ ] 撤回[@xxx] [xxx]
|
- [ ] 撤回[@xxx] [xxx]
|
||||||
- [ ] 警告[@xxx]
|
- [ ] 警告[@xxx]
|
||||||
- [x] run[xxx]
|
- [x] run[xxx]
|
||||||
- 涩图
|
- 涩图 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/setutime"`
|
||||||
- [x] 来份[涩图/二次元/风景]
|
- [x] 搜索图片[P站图片ID]
|
||||||
- [x] 添加[涩图/二次元/风景][P站图片ID]
|
- [x] 搜索图片[图片]
|
||||||
- [x] 删除[涩图/二次元/风景][P站图片ID]
|
- [x] 来份[涩图/二次元/风景/车万]
|
||||||
- [x] setu -s
|
- [x] 添加[涩图/二次元/风景/车万][P站图片ID]
|
||||||
- [x] setu -x
|
- [x] 删除[涩图/二次元/风景/车万][P站图片ID]
|
||||||
- [x] setu -p
|
- [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]
|
||||||
|
- [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...
|
- TODO...
|
||||||
|
|
||||||
### 使用方法
|
### 使用方法
|
||||||
|
|||||||
17
main.go
17
main.go
@ -7,6 +7,7 @@ import (
|
|||||||
easy "github.com/t-tomalak/logrus-easy-formatter"
|
easy "github.com/t-tomalak/logrus-easy-formatter"
|
||||||
zero "github.com/wdvxdr1123/ZeroBot"
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
"github.com/wdvxdr1123/ZeroBot/driver"
|
"github.com/wdvxdr1123/ZeroBot/driver"
|
||||||
|
"github.com/wdvxdr1123/ZeroBot/message"
|
||||||
|
|
||||||
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/chat"
|
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/chat"
|
||||||
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/github"
|
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/github"
|
||||||
@ -25,13 +26,12 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Printf(`
|
var declare = `====================[ZeroBot-Plugin]====================
|
||||||
====================[ZeroBot-Plugin]====================
|
|
||||||
* OneBot + ZeroBot + Golang
|
* 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
|
* Project: https://github.com/Yiwen-Chan/ZeroBot-Plugin
|
||||||
========================================================
|
========================================================`
|
||||||
`)
|
fmt.Println(declare) // 启动打印
|
||||||
zero.Run(zero.Config{
|
zero.Run(zero.Config{
|
||||||
NickName: []string{"椛椛"},
|
NickName: []string{"椛椛"},
|
||||||
CommandPrefix: "/",
|
CommandPrefix: "/",
|
||||||
@ -40,5 +40,12 @@ func main() {
|
|||||||
driver.NewWebSocketClient("127.0.0.1", "6700", ""),
|
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 {}
|
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) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
state := []string{"[SetuTime]"}
|
state := []string{"[SetuTime]"}
|
||||||
for i := range PoolList {
|
for i := range PoolList {
|
||||||
@ -160,14 +160,14 @@ func init() { // 插件主体
|
|||||||
return
|
return
|
||||||
})
|
})
|
||||||
// 开xml模式
|
// 开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) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
FORM = "XML"
|
FORM = "XML"
|
||||||
ctx.Send("[SetuTime] XML->ON")
|
ctx.Send("[SetuTime] XML->ON")
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
// 关xml模式
|
// 关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) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
FORM = "PIC"
|
FORM = "PIC"
|
||||||
ctx.Send("[SetuTime] XML->OFF")
|
ctx.Send("[SetuTime] XML->OFF")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user