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 00:15:57 -0400
committerBenny Morrison <benmorrison@ttm.sh>2019-03-16 00:15:57 -0400
commitff4bdd49040864ac4b6e9e8298bb9d5fc59453e7 (patch)
tree98fac97f6e277401b20472c032c6b2cb1d20fa6a /main.go
parent394f3b5df7809371891e5371943c9665d97ff4a9 (diff)
downloadgoofbot-ff4bdd49040864ac4b6e9e8298bb9d5fc59453e7.tar.gz
added !users to display connected users on server
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/main.go b/main.go
index 23cb061..1e2b94a 100644
--- a/main.go
+++ b/main.go
@@ -54,11 +54,13 @@ func main() {
 			c.Cmd.Reply(e, uptime)
 			return
 		}
-		//TODO:
-		// currently connected users
-		// uptime
-		// load
-		//
+		// respond with currently connected users
+		// TODO: prepend names with _ to avoid pings in irc
+		if strings.HasPrefix(e.Last(), "!users") {
+			users := exec.Command("who", "-q")
+			c.Cmd.Reply(e, users)
+			return
+		}
 	})
 
 	// if err is not nothing, eg, if there's an error