summaryrefslogtreecommitdiff
path: root/weather.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-09-21 23:27:29 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-09-21 23:27:29 +0200
commitdcec8549b4a91863d6f8820582bd757447a6b408 (patch)
tree1e4a4718e0ea6694308bd40a0857c531d89baa0b /weather.go
parent3daaf1f4f28443dfb0439d1f8ced0b129fd89d76 (diff)
Move Help() into interface{}
Diffstat (limited to 'weather.go')
-rw-r--r--weather.go11
1 files changed, 6 insertions, 5 deletions
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{})
}