summaryrefslogtreecommitdiff
path: root/top.go
diff options
context:
space:
mode:
Diffstat (limited to 'top.go')
-rw-r--r--top.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/top.go b/top.go
new file mode 100644
index 0000000..10a557f
--- /dev/null
+++ b/top.go
@@ -0,0 +1,26 @@
+package main
+
+import (
+ "fmt"
+
+ irc "github.com/fluffle/goirc/client"
+)
+
+type Top struct{ Command }
+
+func (_ Top) Handle(conn *irc.Conn, line *irc.Line) {
+ n := 100
+ if line.Public() {
+ n = 10
+ }
+ s := fmt.Sprint(NewScores(n))
+ conn.Privmsg(line.Target(), s)
+}
+
+func init() {
+ Register("top", &Top{
+ Command{
+ Help: "Top 10 flooder (msg private to see top 100)",
+ },
+ })
+}