mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-13 07:37:17 +03:00
/version, /uptime
This commit is contained in:
parent
9335a2139b
commit
c4ffd6f263
18
host.go
18
host.go
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user