/version, /uptime

This commit is contained in:
Andrey Petrov 2015-01-20 14:23:37 -08:00
parent 9335a2139b
commit c4ffd6f263
1 changed files with 18 additions and 0 deletions

18
host.go
View File

@ -311,6 +311,24 @@ func (h *Host) InitCommands(c *chat.Commands) {
},
})
// Hidden commands
c.Add(chat.Command{
Prefix: "/version",
Handler: func(room *chat.Room, msg chat.CommandMsg) error {
room.Send(chat.NewSystemMsg(buildCommit, msg.From()))
return nil
},
})
timeStarted := time.Now()
c.Add(chat.Command{
Prefix: "/uptime",
Handler: func(room *chat.Room, msg chat.CommandMsg) error {
room.Send(chat.NewSystemMsg(time.Now().Sub(timeStarted).String(), msg.From()))
return nil
},
})
// Op commands
c.Add(chat.Command{
Op: true,