From c4ffd6f26373f9d49c36aaca6ff9a5e814d58af5 Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Tue, 20 Jan 2015 14:23:37 -0800 Subject: [PATCH] /version, /uptime --- host.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/host.go b/host.go index e8226f2..baa5095 100644 --- 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,