-
-
Notifications
You must be signed in to change notification settings - Fork 715
Non-staff rule usage alert #3338
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
Conversation
dc4d058
to
b2bf526
Compare
b2bf526
to
3c72b27
Compare
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.
Pull Request Overview
Adds an alert mechanism so whenever a non-staff member uses the !rule
command, a message is sent to a dedicated rules-alerts thread in the Moderator+ channel.
- Introduces a new
rule_alerts
constant for the thread ID - Implements
_send_rules_alert
ininformation.py
and integrates it into therules
command - Updates tests to mock channel fetching for the new alert behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/bot/exts/info/test_information.py | Patches get_channel to simulate the rules-alerts thread in tests |
bot/exts/info/information.py | Adds get_or_fetch_channel import, new _send_rules_alert method, and alert trigger in rules command |
bot/constants.py | Defines rule_alerts channel/thread ID |
Comments suppressed due to low confidence (1)
bot/exts/info/information.py:692
- There is no existing test to verify that non-staff users trigger the rules alert. Consider adding a test case to ensure
_send_rules_alert
is invoked and the alert embed is sent as expected.
if constants.Roles.helpers not in {role.id for role in ctx.author.roles}:
LGTM 👍 |
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.
LGTM
Adds an alert within a Moderator+ channel whenever a non-staff member (user without the Helpers role) uses the
!rule
command.Feature implemented as discussed in
#mod-meta
with Moderators.