about summary refs log tree commit diff stats
path: root/main.go
diff options
context:
space:
mode:
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