Loop on one line

Signed-off-by: Georg <georg@lysergic.dev>
This commit is contained in:
Georg Pfuetzenreuter 2021-09-05 20:20:39 +02:00
parent 452ecd50c5
commit a3b9befdda
Signed by: Georg
GPG Key ID: 1DAF57F49F8E8F22

View File

@ -248,9 +248,11 @@ class Keycloak(callbacks.Plugin):
print(url) print(url)
usergroups = response.json() usergroups = response.json()
if usergroups: if usergroups:
groups = []
for group in usergroups: for group in usergroups:
groupname = group['name'] groupname = group['name']
irc.reply(groupname) groups.append(groupname)
irc.replies(groups, prefixer='Group(s): ', joiner=', ', onlyPrefixFirst=True)
else: else:
irc.reply("No groups.") irc.reply("No groups.")
except: except:
@ -287,9 +289,11 @@ class Keycloak(callbacks.Plugin):
print(url) print(url)
usergroups = response.json() usergroups = response.json()
if usergroups: if usergroups:
groups = []
for group in usergroups: for group in usergroups:
groupname = group['name'] groupname = group['name']
irc.reply(groupname) groups.append(groupname)
irc.replies(groups, prefixer='Group(s): ', joiner=', ', onlyPrefixFirst=True)
else: else:
irc.reply("No groups.") irc.reply("No groups.")
except: except: