package main import ( "fmt" irc "github.com/fluffle/goirc/client" ) type Top struct{ Command } func (_ Top) Handle(conn *irc.Conn, line *irc.Line) { n := 20 if line.Public() { n = 10 } s := fmt.Sprint(NewScores(n)) conn.Notice(line.Target(), s) } func (_ Top) Help() string { return "Top 10 flooder (msg private to see top 100)" } func init() { Register("top", &Top{}) }