update
This commit is contained in:
+5
-2
@@ -50,6 +50,9 @@ func AddCommand(prefix string, cmds []Function) {
|
||||
cmds[j].Rules[i] = strings.Replace(cmds[j].Rules[i], "raw ", "", -1)
|
||||
continue
|
||||
}
|
||||
if strings.Contains(cmds[j].Rules[i], "$") {
|
||||
continue
|
||||
}
|
||||
if prefix != "" {
|
||||
cmds[j].Rules[i] = prefix + `\s+` + cmds[j].Rules[i]
|
||||
}
|
||||
@@ -94,8 +97,8 @@ func handleMessage(sender Sender) {
|
||||
}
|
||||
if matched {
|
||||
if function.Admin && !sender.IsAdmin() {
|
||||
sender.Delete()
|
||||
sender.Disappear()
|
||||
sender.Delete()
|
||||
sender.Disappear()
|
||||
sender.Reply("没有权限操作")
|
||||
sender.Finish()
|
||||
return
|
||||
|
||||
+7
-5
@@ -169,11 +169,13 @@ func init() {
|
||||
return result
|
||||
}
|
||||
logs.Warn("回复:%s添加成功", jr)
|
||||
functions = append(functions, Function{
|
||||
Handle: handler,
|
||||
Rules: rules,
|
||||
Cron: cron,
|
||||
Admin: admin,
|
||||
AddCommand("", []Function{
|
||||
{
|
||||
Handle: handler,
|
||||
Rules: rules,
|
||||
Cron: cron,
|
||||
Admin: admin,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user