From a3b9befdda26787eee81149a4122e7d7b3b30fc9 Mon Sep 17 00:00:00 2001 From: Georg Date: Sun, 5 Sep 2021 20:20:39 +0200 Subject: [PATCH] Loop on one line Signed-off-by: Georg --- plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin.py b/plugin.py index 94adebe..cfa9a9d 100644 --- a/plugin.py +++ b/plugin.py @@ -248,9 +248,11 @@ class Keycloak(callbacks.Plugin): print(url) usergroups = response.json() if usergroups: + groups = [] for group in usergroups: groupname = group['name'] - irc.reply(groupname) + groups.append(groupname) + irc.replies(groups, prefixer='Group(s): ', joiner=', ', onlyPrefixFirst=True) else: irc.reply("No groups.") except: @@ -287,9 +289,11 @@ class Keycloak(callbacks.Plugin): print(url) usergroups = response.json() if usergroups: + groups = [] for group in usergroups: groupname = group['name'] - irc.reply(groupname) + groups.append(groupname) + irc.replies(groups, prefixer='Group(s): ', joiner=', ', onlyPrefixFirst=True) else: irc.reply("No groups.") except: