From 8b6de48a1b56843d157748edcc26018627796c94 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 20 Jul 2015 00:13:55 +0200 Subject: Add blame --- main.go | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'main.go') 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() { -- cgit v1.2.3