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 01:45:24 -0400
committerBenny Morrison <benmorrison@ttm.sh>2019-03-16 01:45:24 -0400
commitf217ab629e71ae55179fed93c28fe4e90eceebbe (patch)
tree2591dadc66cbbfd0a84e8e5356bbbf7f90f1f97d /main.go
parent08824a2040e1c9728e9d5e2c598745894e9884f7 (diff)
downloadgoofbot-f217ab629e71ae55179fed93c28fe4e90eceebbe.tar.gz
expanded !botlist info summary
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 14 insertions, 1 deletions
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