This commit is contained in:
cdle
2021-09-30 17:39:32 +08:00
parent d7d35aaa99
commit d857e5db63
2 changed files with 12 additions and 7 deletions
+5 -2
View File
@@ -50,6 +50,9 @@ func AddCommand(prefix string, cmds []Function) {
cmds[j].Rules[i] = strings.Replace(cmds[j].Rules[i], "raw ", "", -1) cmds[j].Rules[i] = strings.Replace(cmds[j].Rules[i], "raw ", "", -1)
continue continue
} }
if strings.Contains(cmds[j].Rules[i], "$") {
continue
}
if prefix != "" { if prefix != "" {
cmds[j].Rules[i] = prefix + `\s+` + cmds[j].Rules[i] cmds[j].Rules[i] = prefix + `\s+` + cmds[j].Rules[i]
} }
@@ -94,8 +97,8 @@ func handleMessage(sender Sender) {
} }
if matched { if matched {
if function.Admin && !sender.IsAdmin() { if function.Admin && !sender.IsAdmin() {
sender.Delete() sender.Delete()
sender.Disappear() sender.Disappear()
sender.Reply("没有权限操作") sender.Reply("没有权限操作")
sender.Finish() sender.Finish()
return return
+7 -5
View File
@@ -169,11 +169,13 @@ func init() {
return result return result
} }
logs.Warn("回复:%s添加成功", jr) logs.Warn("回复:%s添加成功", jr)
functions = append(functions, Function{ AddCommand("", []Function{
Handle: handler, {
Rules: rules, Handle: handler,
Cron: cron, Rules: rules,
Admin: admin, Cron: cron,
Admin: admin,
},
}) })
} }
} }