From e085b749eff951ddd7c634c4444b661bec8a43d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E6=9F=B3=E7=85=9C?= <101934327+fangliuyu@users.noreply.github.com> Date: Wed, 16 Aug 2023 21:10:26 +0800 Subject: [PATCH] Add files via upload --- plugin/coc/dice.go | 4 ++-- plugin/coc/jsondata.go | 6 +++--- plugin/coc/setting.go | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugin/coc/dice.go b/plugin/coc/dice.go index 907a395a2c..8f0868819e 100644 --- a/plugin/coc/dice.go +++ b/plugin/coc/dice.go @@ -11,7 +11,7 @@ import ( ) func init() { - engine.OnRegex(`^(.|。)(r|R)([1-9]\d*)?(d|D)?([1-9]\d*)?( (.*))?$`, getsetting).SetBlock(true).Handle(func(ctx *zero.Ctx) { + engine.OnRegex(`^(\.|。)(r|R)([1-9]\d*)?(d|D)?([1-9]\d*)?( (.*))?$`, getsetting).SetBlock(true).Handle(func(ctx *zero.Ctx) { defaultDice := 100 mu.Lock() cocSetting := settingGoup[ctx.Event.GroupID] @@ -41,7 +41,7 @@ func init() { } ctx.Send(msg) }) - engine.OnRegex(`^(.|。)(r|R)([1-9]\d*)?(d|D)?([1-9]\d*)?a(\S+)( (.*))?$`, getsetting).SetBlock(true).Handle(func(ctx *zero.Ctx) { + engine.OnRegex(`^(\.|。)(r|R)([1-9]\d*)?(d|D)?([1-9]\d*)?a(\S+)( (.*))?$`, getsetting).SetBlock(true).Handle(func(ctx *zero.Ctx) { gid := ctx.Event.GroupID uid := ctx.Event.UserID mu.Lock() diff --git a/plugin/coc/jsondata.go b/plugin/coc/jsondata.go index 3a46dd9bb2..7e687e9e92 100644 --- a/plugin/coc/jsondata.go +++ b/plugin/coc/jsondata.go @@ -164,10 +164,10 @@ func savePanel(cfg cocJSON, infoID ...int64) error { str += strconv.FormatInt(ID, 10) if i != len(infoID)-1 { str += "/" - //if file.IsNotExist(engine.DataFolder() + str) { + // if file.IsNotExist(engine.DataFolder() + str) { // _, err := os.Create(engine.DataFolder() + str) // return err - //} + // } } } cfgFile = engine.DataFolder() + str + ".json" @@ -185,7 +185,7 @@ func loadSetting(gid int64) (info settingInfo, err error) { defer mu.Unlock() cfgFile := engine.DataFolder() + strconv.FormatInt(gid, 10) + SettingJSONFile if file.IsNotExist(cfgFile) { - //info.DefaultDice = 100 + // info.DefaultDice = 100 return } reader, err := os.Open(cfgFile) diff --git a/plugin/coc/setting.go b/plugin/coc/setting.go index 2479e7483e..f53617e83b 100644 --- a/plugin/coc/setting.go +++ b/plugin/coc/setting.go @@ -122,7 +122,7 @@ func init() { } ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("成功")) }) - engine.OnRegex(`^(.|。)(s|S)(a|A) ([1-9]\d*)?(d|D)([1-9]\d*)?(a(\S+))? (\S+) ((-|\+)?[1-9]\d*)(\s+([1-9]\d*))?$`, getsetting).SetBlock(true).Handle(func(ctx *zero.Ctx) { + engine.OnRegex(`^(\.|。)(s|S)(a|A) ([1-9]\d*)?(d|D)([1-9]\d*)?(a(\S+))? (\S+) ((-|\+)?[1-9]\d*)(\s+([1-9]\d*))?$`, getsetting).SetBlock(true).Handle(func(ctx *zero.Ctx) { gid := ctx.Event.GroupID mu.Lock() cocSetting := settingGoup[gid] @@ -249,7 +249,7 @@ func init() { ctx.Send(msg) }) - engine.OnRegex(`^(.|。)(setpc|SETPC)(\[CQ:at,qq=)?(\d+)(\])?`, getsetting, zero.AdminPermission).SetBlock(true).Handle(func(ctx *zero.Ctx) { + engine.OnRegex(`^(\.|。)(setpc|SETPC)(\[CQ:at,qq=)?(\d+)(\])?`, getsetting, zero.AdminPermission).SetBlock(true).Handle(func(ctx *zero.Ctx) { gid := ctx.Event.GroupID mu.Lock() cocSetting := settingGoup[gid] @@ -328,7 +328,7 @@ func init() { } ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("成功")) }) - engine.OnRegex(`^(.|。)(show|SHOW)(\[CQ:at,qq=)?(\d+)(\])?`, getsetting, func(ctx *zero.Ctx) bool { + engine.OnRegex(`^(\.|。)(show|SHOW)(\[CQ:at,qq=)?(\d+)(\])?`, getsetting, func(ctx *zero.Ctx) bool { mu.Lock() cocSetting := settingGoup[ctx.Event.GroupID] mu.Unlock() @@ -362,7 +362,7 @@ func init() { } ctx.SendChain(message.Reply(ctx.Event.MessageID), message.ImageBytes(pic)) }) - engine.OnRegex(`^(.|。)(kill|KILL)(\[CQ:at,qq=)?(\d+)?(\])?`, getsetting, func(ctx *zero.Ctx) bool { + engine.OnRegex(`^(\.|。)(kill|KILL)(\[CQ:at,qq=)?(\d+)?(\])?`, getsetting, func(ctx *zero.Ctx) bool { uid, err := strconv.ParseInt(ctx.State["regex_matched"].([]string)[4], 10, 64) if err != nil { ctx.SendChain(message.Text("[ERROR]:", err)) @@ -396,7 +396,7 @@ func init() { } ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("成功")) }) - engine.OnRegex(`^(.|。)(pcset|PCSET)(\[CQ:at,qq=)?(\d+)(\])? (.*)$`, getsetting, func(ctx *zero.Ctx) bool { + engine.OnRegex(`^(\.|。)(pcset|PCSET)(\[CQ:at,qq=)?(\d+)(\])? (.*)$`, getsetting, func(ctx *zero.Ctx) bool { mu.Lock() cocSetting := settingGoup[ctx.Event.GroupID] mu.Unlock()