package main import ( "fmt" "time" irc "github.com/fluffle/goirc/client" ) type Uptime struct { Command boot time.Time } func (u Uptime) Handle(conn *irc.Conn, line *irc.Line) { conn.Notice(line.Nick, fmt.Sprint(time.Since(u.boot))) } func (_ Uptime) Help() string { return "Bot's uptime" } func init() { Register("uptime", &Uptime{boot: time.Now()}) }