summaryrefslogtreecommitdiff
path: root/weather.go
diff options
context:
space:
mode:
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{})
}