summaryrefslogtreecommitdiff
path: root/command.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-01-01 09:49:01 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-01-01 09:49:01 +0100
commit2e61e20da46d10af33a84a18dc2e1b77e43002b3 (patch)
tree7245894614a2c5c294cd48047f3d2b2a2cf4ccea /command.go
parent50d3b0f4927c3fc4b92cc368062ce2bf42e1a99d (diff)
parente663cdca3df5471ffbf7bfc2d329e7780e5ccf6f (diff)
Merge branch 'kiss'
Diffstat (limited to 'command.go')
-rw-r--r--command.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/command.go b/command.go
deleted file mode 100644
index 9f20c45..0000000
--- a/command.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package main
-
-import (
- "fmt"
- "log"
- "strings"
-
- irc "github.com/fluffle/goirc/client"
-)
-
-type Commander interface {
- irc.Handler
- fmt.Stringer
-}
-
-const maxLen = 500
-
-var commands = make(map[string]Commander)
-
-func Register(cmd string, f Commander) {
- commands[cmd] = f
-}
-
-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 {
- log.Println(line.Nick, f)
- c.Handle(conn, line)
- }
- }
-}