mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-14 16:17: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
|
// Op commands
|
||||||
c.Add(chat.Command{
|
c.Add(chat.Command{
|
||||||
Op: true,
|
Op: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user