Skip to content

Commit

Permalink
core: parse /userlist
Browse files Browse the repository at this point in the history
TODO: implement with /cmd instead (#14)
  • Loading branch information
Annika committed May 29, 2020
1 parent 5a0847a commit e331f2e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def join(self):
"""
self.connection.send("|/j " + self.id)
self.say('/roomauth')
self.say('/userlist')

def usersWithRankGEQ(self, rank):
"""Gets a list of userids of the roomauth whose room rank is greater than or equal to a certain rank
Expand Down Expand Up @@ -262,6 +263,15 @@ def __init__(self, raw, connection):

authList = {'#': owners, '*': bots, '@': mods, '%': drivers, '+': voices}
room.updateAuth(authList)
elif self.type == 'html':
self.room = connection.getRoomByID(split[0].strip('>').strip('\n'))
if "users in this room:" in raw:
userList = split[2].split("users in this room:<br />")[1].strip("</div>").split(", ")
for user in userList:
userObject = self.connection.getUser(toID(user))
if not userObject: userObject = User(toID(user), self.connection)
self.connection.userJoinedRoom(userObject, self.room)
elif self.type == 'init':
else:
log("DEBUG: Message() of unknown type {type}: {raw}".format(type = self.type, raw = raw))
if self.body and ' ' in self.body:
Expand Down

0 comments on commit e331f2e

Please sign in to comment.