From f217ab629e71ae55179fed93c28fe4e90eceebbe Mon Sep 17 00:00:00 2001 From: Benny Morrison Date: Sat, 16 Mar 2019 01:45:24 -0400 Subject: expanded !botlist info summary --- main.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 4510c68..f86e9a1 100644 --- a/main.go +++ b/main.go @@ -50,7 +50,7 @@ func main() { } //another basic command/response. required information for the tildeverse if strings.HasPrefix(e.Last(), "!botlist") { - c.Cmd.Reply(e, "Creator: ~a h r i m a n~ :: I'm the assistance bot for tilde.institute. Commands: !hello") + c.Cmd.Reply(e, "Creator: ~a h r i m a n~ :: I'm the assistance bot for tilde.institute. Commands: !hello !join !uptime !users") return } // when requested by owner, join channel specified @@ -85,6 +85,19 @@ func main() { c.Cmd.Reply(e, out.String()) return } + // number of total users + // bot dies when i run this + // TODO: defuckulate this command + if strings.HasPrefix(e.Last(), "!totalusers") { + users := exec.Command("ls /home | wc -w") + var out bytes.Buffer + users.Stdout = &out + err := users.Run() + if err != nil { + log.Fatalln("Error while running 'ls /home | wc -w'") + } + c.Cmd.Reply(e, out.String()) + } }) // if err is not nothing, eg, if there's an error -- cgit 1.4.1-2-gfad0