diff options
author | Benny Morrison <benmorrison@ttm.sh> | 2019-03-16 00:13:25 -0400 |
---|---|---|
committer | Benny Morrison <benmorrison@ttm.sh> | 2019-03-16 00:13:25 -0400 |
commit | 394f3b5df7809371891e5371943c9665d97ff4a9 (patch) | |
tree | 23c964d14a6e90017649d67d4fe74b993b849ccb | |
parent | 32a5ae65d4de5c7c36452911d407f68f5d041f97 (diff) | |
download | goofbot-394f3b5df7809371891e5371943c9665d97ff4a9.tar.gz |
added !uptime command
-rw-r--r-- | main.go | 7 |
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 |