Skip to content

Commit 9a2081d

Browse files
🎨 改进代码样式 (#521)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 9550b81 commit 9a2081d

File tree

7 files changed

+16
-18
lines changed

7 files changed

+16
-18
lines changed

plugin/baiduaudit/audit.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ func init() {
157157
if !find {
158158
msgs += "无"
159159
}
160-
161160
} else {
162161
// 生成配置文本
163162
msgs = fmt.Sprintf("本群配置:\n"+
@@ -187,9 +186,9 @@ func init() {
187186
group := getGroup(ctx.Event.GroupID)
188187
inputType, _ := strconv.Atoi(k2)
189188
if k1 == "不" {
190-
group.WhiteListType[inputType] = true //不检测:则进入类型白名单
189+
group.WhiteListType[inputType] = true // 不检测:则进入类型白名单
191190
} else {
192-
group.WhiteListType[inputType] = false //检测:则退出白名单
191+
group.WhiteListType[inputType] = false // 检测:则退出白名单
193192
}
194193
config.Groups[ctx.Event.GroupID] = group
195194
ctx.SendChain(message.At(ctx.Event.UserID), message.Text(fmt.Sprintf("本群将%s检测%s类型内容", k1, typetext[inputType])))
@@ -324,7 +323,6 @@ func init() {
324323
}
325324
group := getGroup(ctx.Event.GroupID)
326325
ctx.SendChain(buildResp(bdres, group)...)
327-
328326
})
329327
}
330328

@@ -367,10 +365,10 @@ func banCheck(ctx *zero.Ctx, bdres baiduRes) {
367365
} else {
368366
bantime = group.BANTime * 60
369367
}
370-
//执行禁言
368+
// 执行禁言
371369
ctx.SetGroupBan(ctx.Event.GroupID, ctx.Event.UserID, bantime)
372370
}
373-
//查看是否开启撤回提示
371+
// 查看是否开启撤回提示
374372
if group.DMRemind {
375373
res = append(res, message.At(ctx.Event.Sender.ID))
376374
ctx.SendChain(res...)

plugin/manager/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func init() { // 插件主体
271271
// 删除需要撤回的消息ID
272272
ctx.DeleteMessage(message.NewMessageIDFromString(ctx.State["regex_matched"].([]string)[1]))
273273
// 删除请求撤回的消息ID
274-
//ctx.DeleteMessage(message.NewMessageIDFromInteger(ctx.Event.MessageID.(int64)))
274+
// ctx.DeleteMessage(message.NewMessageIDFromInteger(ctx.Event.MessageID.(int64)))
275275
})
276276
// 群聊转发
277277
engine.OnRegex(`^群聊转发.*?(\d+)\s(.*)`, zero.SuperUserPermission).SetBlock(true).

plugin/qqwife/command.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func init() {
282282
err = 民政局.清理花名册("group" + strconv.FormatInt(ctx.Event.GroupID, 10))
283283
default:
284284
cmd := ctx.State["regex_matched"].([]string)[1]
285-
gid, _ := strconv.ParseInt(cmd, 10, 64) //判断是否为群号
285+
gid, _ := strconv.ParseInt(cmd, 10, 64) // 判断是否为群号
286286
if gid == 0 {
287287
ctx.SendChain(message.Text("请输入正确的群号"))
288288
return
@@ -431,7 +431,6 @@ func (sql *婚姻登记) 清理花名册(gid ...string) error {
431431
for _, listName := range grouplist {
432432
if listName == "favorability" {
433433
continue
434-
435434
}
436435
err = sql.db.Drop(listName)
437436
}

plugin/qqwife/function.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func init() {
193193
var choicetext string
194194
var ntrID = uid
195195
var targetID = fiancee
196-
var greenID int64 //被牛的
196+
var greenID int64 // 被牛的
197197
fianceeInfo, err := 民政局.查户口(gid, fiancee)
198198
switch {
199199
case err != nil:

plugin/quan/quan.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ package quan
33

44
import (
55
"fmt"
6+
"strconv"
7+
68
"github.com/FloatTech/floatbox/web"
79
ctrl "github.com/FloatTech/zbpctrl"
810
"github.com/FloatTech/zbputils/control"
911
zero "github.com/wdvxdr1123/ZeroBot"
1012
"github.com/wdvxdr1123/ZeroBot/message"
1113
"github.com/wdvxdr1123/ZeroBot/utils/helper"
12-
"strconv"
1314
)
1415

1516
const (
@@ -25,8 +26,8 @@ func init() { // 主函数
2526
"- 权重查询+QQ号(可以不写,默认本人)",
2627
})
2728
en.OnRegex(`^权重查询\s*(\[CQ:at,qq=)?(\d+)?`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
28-
str := ctx.State["regex_matched"].([]string)[2] //获取uid
29-
if str == "" { //user
29+
str := ctx.State["regex_matched"].([]string)[2] // 获取uid
30+
if str == "" { // user
3031
str = strconv.FormatInt(ctx.Event.UserID, 10)
3132
}
3233
es, err := web.GetData(fmt.Sprintf(quan, str)) // 将网站返回结果赋值
@@ -36,5 +37,4 @@ func init() { // 主函数
3637
}
3738
ctx.SendChain(message.Text(str, helper.BytesToString(es))) // 输出结果
3839
})
39-
4040
}

plugin/wenben/wenben.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ package wenben
44
import (
55
"encoding/json"
66
"fmt"
7+
"strings"
8+
79
"github.com/FloatTech/floatbox/web"
810
ctrl "github.com/FloatTech/zbpctrl"
911
"github.com/FloatTech/zbputils/control"
1012
zero "github.com/wdvxdr1123/ZeroBot"
1113
"github.com/wdvxdr1123/ZeroBot/message"
1214
"github.com/wdvxdr1123/ZeroBot/utils/helper"
13-
"strings"
1415
)
1516

1617
const (
1718
tianqi = "https://xiaobai.klizi.cn/API/other/weather_1.php?data=&msg=%v" // api地址
1819
pinyin = "http://ovooa.com/API/pinyin/api.php?type=text&msg=%v"
1920
yiyan = "https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i" // 动漫 漫画 游戏 文学 影视 诗词
20-
kouling = "http://ovooa.com/API/rao/api.php?type=text" //口令
21+
kouling = "http://ovooa.com/API/rao/api.php?type=text" // 口令
2122
tang = "http://api.btstu.cn/yan/api.php?charset=utf-8&encode=text"
2223
qing = "https://xiaobai.klizi.cn/API/other/wtqh.php"
2324
)
@@ -86,7 +87,7 @@ func init() { // 主函数
8687
}
8788
ctx.SendChain(message.Text(helper.BytesToString(data)))
8889
})
89-
en.OnFullMatch("每日一言").SetBlock(true).Handle(func(ctx *zero.Ctx) { //每日一言
90+
en.OnFullMatch("每日一言").SetBlock(true).Handle(func(ctx *zero.Ctx) { // 每日一言
9091
var rsp rspData
9192
data, err := web.GetData(yiyan)
9293
if err != nil {

plugin/ygo/ygocdb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type searchResult struct {
4141
func init() {
4242
en := control.Register("ygocdb", &ctrl.Options[*zero.Ctx]{
4343
DisableOnDefault: false,
44-
Brief: "游戏王百鸽API",// 本插件基于游戏王百鸽API"https://www.ygo-sem.cn/"
44+
Brief: "游戏王百鸽API", // 本插件基于游戏王百鸽API"https://www.ygo-sem.cn/"
4545
Help: "- /ydp [xxx]\n" +
4646
"- /yds [xxx]\n" +
4747
"- /ydb [xxx]\n" +

0 commit comments

Comments
 (0)