More fixes to users.. i can't use break it seems
This commit is contained in:
parent
fb3046b11e
commit
e1e162643d
|
@ -40,6 +40,7 @@ class MatrixModule(BotModule):
|
|||
else:
|
||||
reply = f'I am seeing {len(allusers)} users in this room:\n'
|
||||
for name in stats:
|
||||
if stats[name] > 0:
|
||||
reply = reply + f' - {name}: {stats[name]} ({round(stats[name] / total * 100, 2)}%)\n'
|
||||
await bot.send_text(room, reply)
|
||||
return
|
||||
|
@ -91,8 +92,7 @@ class MatrixModule(BotModule):
|
|||
def get_users(self, bot, roomid=None):
|
||||
allusers = []
|
||||
for croomid in self.bot.client.rooms:
|
||||
if roomid and (roomid != croomid):
|
||||
break
|
||||
if not roomid or (roomid == croomid):
|
||||
try:
|
||||
users = self.bot.client.rooms[croomid].users
|
||||
except (KeyError, ValueError) as e:
|
||||
|
|
Loading…
Reference in New Issue