From c8c80becf658693e4d5b4979c988e47beb9f5e11 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Fri, 3 Apr 2020 02:48:37 -0400 Subject: changed how user account count message is formatted using full path to uptime command --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index e7e97e7..e92dfb5 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,4 @@ -package main // import "github.com/gbmor/goofbot" +package main import ( "bytes" @@ -10,7 +10,6 @@ import ( "os" "os/exec" "os/signal" - "strconv" "strings" "time" @@ -138,7 +137,7 @@ func main() { // respond with uptime / load if strings.HasPrefix(e.Last(), "!uptime") { - uptime := exec.Command("uptime") + uptime := exec.Command("/usr/bin/uptime") var out bytes.Buffer uptime.Stdout = &out err := uptime.Run() @@ -191,7 +190,8 @@ func main() { return } - c.Cmd.Reply(e, strconv.Itoa(len(userdirs))+" user accounts on ~institute") + msg := fmt.Sprintf("%v user accounts on ~institute", len(userdirs)) + c.Cmd.Reply(e, msg) return } -- cgit 1.4.1-2-gfad0