From ff4bdd49040864ac4b6e9e8298bb9d5fc59453e7 Mon Sep 17 00:00:00 2001 From: Benny Morrison Date: Sat, 16 Mar 2019 00:15:57 -0400 Subject: added !users to display connected users on server --- main.go | 12 +++++++----- 1 file 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 -- cgit 1.4.1-2-gfad0