/version, /uptime
authorAndrey Petrov <andrey.petrov@shazow.net>
Tue, 20 Jan 2015 22:23:37 +0000 (14:23 -0800)
committerAndrey Petrov <andrey.petrov@shazow.net>
Tue, 20 Jan 2015 22:23:37 +0000 (14:23 -0800)
host.go

diff --git a/host.go b/host.go
index e8226f28f6c101751a009c83009be250e79e5b20..baa50953173f08b560adb8cd39b30162c182e74c 100644 (file)
--- a/host.go
+++ b/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,