-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check sender and bot PL before accepting room reminder #157
base: master
Are you sure you want to change the base?
Conversation
bot_pl = self.room.power_levels.users.get(self.client.user_id, 0) | ||
if sender_pl < room_ping_pl: | ||
insufficient = f"You (<code>{sender_pl}</code>) do" | ||
elif bot_pl < room_ping_pl: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the use case of #80 is not possible to partially work around with PLs anymore, so it now needs to get addressed more than ever.
text = f"Insufficient rights: {insufficient} not have the required power level to ping the whole room (<code>{room_ping_pl}</code>)." | ||
await send_text_to_room(self.client, self.room.room_id, text) | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text = f"Insufficient rights: {insufficient} not have the required power level to ping the whole room (<code>{room_ping_pl}</code>)." | |
await send_text_to_room(self.client, self.room.room_id, text) | |
return True | |
raise CommandError(f"Insufficient rights: {insufficient} not have the required power level to ping the whole room (<code>{room_ping_pl}</code>).") |
if await self._insufficient_room_ping_pl(): | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if await self._insufficient_room_ping_pl(): | |
return | |
self._insufficient_room_ping_pl() |
fixes #137
outstanding: #80, #158