From 24a94e790aad05680413bf1bb6b90d199239394e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 21 Mar 2016 20:34:04 +0100 Subject: Remvoe rotten code --- weather.go | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 weather.go (limited to 'weather.go') diff --git a/weather.go b/weather.go deleted file mode 100644 index 312b330..0000000 --- a/weather.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "fmt" - "strings" - - "dim13.org/weather" - irc "github.com/fluffle/goirc/client" -) - -type Weather struct { - Command - lastCity map[string]string -} - -func (_ Weather) WithArgs(_ int) bool { return true } - -func (w *Weather) Handle(conn *irc.Conn, line *irc.Line) { - var city string - q := strings.SplitN(line.Text(), " ", 2) - if len(q) == 2 { - city = q[1] - } else if l, ok := w.lastCity[line.Nick]; ok { - city = l - } else { - conn.Notice(line.Target(), "set your location first") - return - } - if c, err := weather.ByCityName(city); err != nil { - conn.Notice(line.Target(), err.Error()) - } else { - conn.Notice(line.Target(), fmt.Sprint(c)) - w.lastCity[line.Nick] = city - } -} - -func (_ Weather) Help() string { - return "Fetch current weather" -} - -func init() { - Register("weather", &Weather{lastCity: make(map[string]string)}) -} -- cgit v1.2.3