1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-05 00:50:25 +08:00

fix cust cmd rule

This commit is contained in:
源文雨
2022-10-06 15:19:41 +08:00
parent 60552ff07d
commit 3d4c3d447f

View File

@@ -105,9 +105,12 @@ func CommandRule(commands ...string) Rule {
case ctx.IsToMe && msg.IsCommand():
cmdMessage = msg.Command()
args = msg.CommandArguments()
logrus.Debugln("CommandRule: IsCommand:", cmdMessage, "args:", args)
case strings.HasPrefix(msg.Text, "/"):
cmdMessage, args, _ = strings.Cut(msg.Text, " ")
cmdMessage, _, _ = strings.Cut(cmdMessage, "@")
cmdMessage = cmdMessage[1:]
logrus.Debugln("CommandRule: has/prefix:", cmdMessage, "args:", args)
default:
return false
}