From e060f8557ec6762c5a7499e9d77067cc98f21de2 Mon Sep 17 00:00:00 2001 From: Yiwen-Chan Date: Sat, 17 Apr 2021 16:50:15 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 29 ++++++++++++++++++++--------- main.go | 17 ++++++++++++----- setutime/setu_geter.go | 6 +++--- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 46aa996f..d5c1cb8d 100644 --- a/README.md +++ b/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... ### 使用方法 diff --git a/main.go b/main.go index 39ef076d..f0f79753 100644 --- a/main.go +++ b/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 {} } diff --git a/setutime/setu_geter.go b/setutime/setu_geter.go index 0d9d3d40..401fcb77 100644 --- a/setutime/setu_geter.go +++ b/setutime/setu_geter.go @@ -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")