Disregard previous - PL50 should be fine. Problem is with IRC bridge. Probably.
This commit is contained in:
parent
34b642840a
commit
a1f1a53a84
7
bot.py
7
bot.py
|
@ -160,16 +160,15 @@ class Bot:
|
|||
if not self.is_owner(event):
|
||||
raise CommandRequiresOwner
|
||||
|
||||
# Returns true if event's sender is admin in the room event was sent in,
|
||||
# Returns true if event's sender has PL50 or more in the room event was sent in,
|
||||
# or is bot owner
|
||||
# Note: Bridged userd seem to get PL50 automatically so this has to be
|
||||
# set to more than 50. TODO: Make configurable
|
||||
# TODO: Make configurable
|
||||
def is_admin(self, room, event):
|
||||
if self.is_owner(event):
|
||||
return True
|
||||
if event.sender not in room.power_levels.users:
|
||||
return False
|
||||
return room.power_levels.users[event.sender] > 50
|
||||
return room.power_levels.users[event.sender] >= 50
|
||||
|
||||
# Returns true if event's sender is owner of the bot
|
||||
def is_owner(self, event):
|
||||
|
|
Loading…
Reference in New Issue