Disregard previous - PL50 should be fine. Problem is with IRC bridge. Probably.

This commit is contained in:
Ville Ranki 2020-09-12 18:13:22 +03:00
parent 34b642840a
commit a1f1a53a84
1 changed files with 3 additions and 4 deletions

7
bot.py
View File

@ -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):