summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-07-12 13:43:32 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-07-12 13:43:32 +0200
commitab65e05ac72a2370ad27b865f5eab88fd4908942 (patch)
tree76d7616ae565d40dd0147fe1741ce9f2333449fd /main.go
parent1bedad0603c612f612ab34bb875a5bafc9b3d74a (diff)
Add link caching
Diffstat (limited to 'main.go')
-rw-r--r--main.go21
1 files changed, 16 insertions, 5 deletions
diff --git a/main.go b/main.go
index b2b4924..8a02ea3 100644
--- a/main.go
+++ b/main.go
@@ -31,11 +31,12 @@ type Command struct {
}
type (
- Last struct{ Command }
- RSS struct{ Command }
- Theo struct{ Command }
- Help struct{ Command }
- Top struct{ Command }
+ Last struct{ Command }
+ RSS struct{ Command }
+ Theo struct{ Command }
+ Help struct{ Command }
+ Top struct{ Command }
+ Links struct{ Command }
)
var (
@@ -96,6 +97,10 @@ func (_ Top) Handle(conn *irc.Conn, line *irc.Line) {
conn.Privmsg(line.Target(), s)
}
+func (_ Links) Handle(conn *irc.Conn, line *irc.Line) {
+ conn.Privmsg(line.Nick, showLinks())
+}
+
func privmsg(conn *irc.Conn, line *irc.Line) {
f := strings.Fields(line.Text())
@@ -177,6 +182,12 @@ func init() {
Help: "Top 10 flooder",
},
})
+ Register("links", Links{
+ Command{
+ Help: "Show cached links",
+ },
+ })
+
}
func main() {