summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-07-20 00:13:55 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-07-20 00:13:55 +0200
commit8b6de48a1b56843d157748edcc26018627796c94 (patch)
tree3d9ce06bb94cf09390bfe09e5e531b96ab79d45c /main.go
parent9e84f70c0ff3582d5627a2d6e3230707d4d08ad3 (diff)
Add blame
Diffstat (limited to 'main.go')
-rw-r--r--main.go28
1 files changed, 22 insertions, 6 deletions
diff --git a/main.go b/main.go
index ac37d16..ce6f521 100644
--- a/main.go
+++ b/main.go
@@ -35,12 +35,13 @@ type Command struct {
}
type (
- Last struct{ Command }
- RSS struct{ Command }
- Theo struct{ Command }
- Help struct{ Command }
- Top struct{ Command }
- Duck struct{ Command }
+ Last struct{ Command }
+ RSS struct{ Command }
+ Theo struct{ Command }
+ Help struct{ Command }
+ Top struct{ Command }
+ Duck struct{ Command }
+ Blame struct{ Command }
)
var (
@@ -126,6 +127,16 @@ func (_ Duck) Handle(conn *irc.Conn, line *irc.Line) {
}
}
+func (_ Blame) Handle(conn *irc.Conn, line *irc.Line) {
+ src := []string{
+ "Source: http://www.dim13.org/cgi-bin/cgit.cgi/bot.git/",
+ "Install: go get dim13.org/bot",
+ }
+ for _, s := range src {
+ conn.Privmsg(line.Target(), s)
+ }
+}
+
func privmsg(conn *irc.Conn, line *irc.Line) {
f := strings.Fields(line.Text())
@@ -214,6 +225,11 @@ func init() {
Help: "Perform duckduckgo instant answer search",
},
})
+ Register("blame", &Blame{
+ Command{
+ Help: "Blame author and return link to source code",
+ },
+ })
}
func main() {