mirror of
https://github.com/fumiama/ReiBot.git
synced 2026-06-11 05:30:38 +08:00
fix cust cmd rule
This commit is contained in:
3
rules.go
3
rules.go
@@ -105,9 +105,12 @@ func CommandRule(commands ...string) Rule {
|
|||||||
case ctx.IsToMe && msg.IsCommand():
|
case ctx.IsToMe && msg.IsCommand():
|
||||||
cmdMessage = msg.Command()
|
cmdMessage = msg.Command()
|
||||||
args = msg.CommandArguments()
|
args = msg.CommandArguments()
|
||||||
|
logrus.Debugln("CommandRule: IsCommand:", cmdMessage, "args:", args)
|
||||||
case strings.HasPrefix(msg.Text, "/"):
|
case strings.HasPrefix(msg.Text, "/"):
|
||||||
cmdMessage, args, _ = strings.Cut(msg.Text, " ")
|
cmdMessage, args, _ = strings.Cut(msg.Text, " ")
|
||||||
cmdMessage, _, _ = strings.Cut(cmdMessage, "@")
|
cmdMessage, _, _ = strings.Cut(cmdMessage, "@")
|
||||||
|
cmdMessage = cmdMessage[1:]
|
||||||
|
logrus.Debugln("CommandRule: has/prefix:", cmdMessage, "args:", args)
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user