summaryrefslogtreecommitdiff
path: root/top.go
blob: db0c8c20df79064f29f73e077fb0fd3c11375c6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 := 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{})
}