Skip to content

Commit

Permalink
✏️ 统一风格
Browse files Browse the repository at this point in the history
  • Loading branch information
kanrichan committed Apr 17, 2021
1 parent 5ea7de3 commit e060f85
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


### 功能
- 群管
- 群管 `import _ "github.com/Yiwen-Chan/ZeroBot-Plugin/manager"`
- [x] 禁言[@xxx][分钟]
- [x] 解除禁言[@xxx]
- [x] 我要自闭 [分钟]
Expand All @@ -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...

### 使用方法
Expand Down
17 changes: 12 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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: "/",
Expand All @@ -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 {}
}
6 changes: 3 additions & 3 deletions setutime/setu_geter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
Expand Down

0 comments on commit e060f85

Please sign in to comment.