about summary refs log tree commit diff stats
path: root/main.go
diff options
context:
space:
mode:
authorBenny Morrison <benmorrison@ttm.sh>2019-03-16 00:13:25 -0400
committerBenny Morrison <benmorrison@ttm.sh>2019-03-16 00:13:25 -0400
commit394f3b5df7809371891e5371943c9665d97ff4a9 (patch)
tree23c964d14a6e90017649d67d4fe74b993b849ccb /main.go
parent32a5ae65d4de5c7c36452911d407f68f5d041f97 (diff)
downloadgoofbot-394f3b5df7809371891e5371943c9665d97ff4a9.tar.gz
added !uptime command
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.go b/main.go
index 72c0c9f..23cb061 100644
--- a/main.go
+++ b/main.go
@@ -3,6 +3,7 @@ package main
 import (
 	"log"
 	"os"
+	"os/exec"
 	"strings"
 	"time"
 
@@ -47,6 +48,12 @@ func main() {
 			c.Cmd.Reply(e, "Creator: ~a h r i m a n~ :: I'm the assistance bot for tilde.institute. Commands: !hello")
 			return
 		}
+		// respond with uptime / load
+		if strings.HasPrefix(e.Last(), "!uptime") {
+			uptime := exec.Command("uptime")
+			c.Cmd.Reply(e, uptime)
+			return
+		}
 		//TODO:
 		// currently connected users
 		// uptime