From dcec8549b4a91863d6f8820582bd757447a6b408 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 21 Sep 2015 23:27:29 +0200 Subject: Move Help() into interface{} --- weather.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'weather.go') diff --git a/weather.go b/weather.go index 1c9792b..bada901 100644 --- a/weather.go +++ b/weather.go @@ -11,6 +11,7 @@ import ( type Weather struct{ Command } func (_ Weather) WithArgs(_ int) bool { return true } + func (_ Weather) Handle(conn *irc.Conn, line *irc.Line) { if q := strings.SplitN(line.Text(), " ", 2); len(q) == 2 { if c, err := weather.ByCityName(q[1]); err != nil { @@ -21,10 +22,10 @@ func (_ Weather) Handle(conn *irc.Conn, line *irc.Line) { } } +func (_ Weather) Help() string { + return "Fetch current weather" +} + func init() { - Register("weather", &Weather{ - Command{ - Help: "Fetch current weather", - }, - }) + Register("weather", &Weather{}) } -- cgit v1.2.3