Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
fangliuyu authored Aug 16, 2023
1 parent f826643 commit e085b74
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions plugin/coc/dice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions plugin/coc/jsondata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions plugin/coc/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit e085b74

Please sign in to comment.