summaryrefslogtreecommitdiff
path: root/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'command.go')
-rw-r--r--command.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/command.go b/command.go
index f576b13..f2f085b 100644
--- a/command.go
+++ b/command.go
@@ -48,8 +48,12 @@ func Dispatch(conn *irc.Conn, line *irc.Line) {
if f := strings.Fields(line.Text()); len(f) > 0 {
cmd := strings.ToLower(f[0])
if c, ok := commands[cmd]; ok {
- if c.WithArgs(len(f)) &&
- !(line.Public() && c.Timeout(line.Nick)) {
+ if line.Public() && c.Timeout(line.Nick) {
+ log.Println("timeout", line.Nick)
+ conn.Kick(*room, line.Nick, "timeout")
+ return
+ }
+ if c.WithArgs(len(f)) {
log.Println(line.Nick, f)
c.Handle(conn, line)
}