Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

HarHarLinks
Copy link
Collaborator

@HarHarLinks HarHarLinks commented Feb 17, 2024

fixes #137

outstanding: #80, #158

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:
Copy link
Collaborator Author

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.

@HarHarLinks HarHarLinks marked this pull request as draft February 17, 2024 12:59
Comment on lines +351 to +353
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>).")

Comment on lines +357 to +358
if await self._insufficient_room_ping_pl():
return
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if await self._insufficient_room_ping_pl():
return
self._insufficient_room_ping_pl()

@HarHarLinks HarHarLinks added the enhancement New feature or request label Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit creating room reminders to users with sufficient power level
1 participant