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)", }, }) }