Prevent non-commands being passed to antispam check.
parent
e72ec5f3e4
commit
3ea158f25a
5
main.go
5
main.go
|
@ -414,6 +414,11 @@ func main() {
|
|||
log.Printf("<%s @ %s> %s", event.Nick, target, msg)
|
||||
|
||||
cmd := parseCommand(msg)
|
||||
isCommand := !isChannel || strings.HasPrefix(cmd.Name, "!")
|
||||
if !isCommand {
|
||||
return
|
||||
}
|
||||
|
||||
log.Printf("Antispam check: %s, %s", event.Source, cmd.Name)
|
||||
if ok, duration := antispamInstance.Check(event.Source, cmd.Name); !ok {
|
||||
conn.Noticef(sender, "Sorry, please try again %s.", humanize.Time(time.Now().Add(duration)))
|
||||
|
|
Loading…
Reference in New Issue