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

Show the reason in infraction confirmation message if the actor is the bot #504

merged 2 commits into from Oct 8, 2019


Copy link

commented Oct 8, 2019

This PR adds the reason back to the infraction confirmation message the bot sends after successfully applying an infraction, but only if the actor is the bot itself. The reason is that if the bot itself invokes the infraction, having the reason it did that stated in the confirmation message will give context to what's going to those involved in the conversation.



If the actor of the infraction is not the bot, then the reason will not be displayed in the confirmation message:

This PR closes #476

SebastiaanZ added 2 commits Oct 8, 2019
As mentioned in #476, the bot currently sets the actor of infractions
applied due to an antispam rule trigger to the offending member. The
reason is that we get a `Context` object from the message that
triggered the antispam rule, which was sent by the offender.

I've changed it by patching both available author attributes,
`` and `` with the bot user.

We recently decided to hide the reason in the confirmation message
the bot sends after applying an infraction. In most situations, this
makes sense, since the message containing the invocation command
already contains the reason.

However, if the infraction was triggered by the bot itself (e.g., an
antispam trigger), this means that we're missing information that
provides context to the infraction.

This commit adds the reason back to the confirmation message, but
only if the actor of the infraction was the bot itself.

Closes #476
sco1 approved these changes Oct 8, 2019
MarkKoz approved these changes Oct 8, 2019
@MarkKoz MarkKoz merged commit 50c1c06 into master Oct 8, 2019
2 checks passed
2 checks passed
Bot Build #20191008.7 succeeded
Bot (Lint & Test) Lint & Test succeeded
@MarkKoz MarkKoz deleted the show-reason-bot-actor-infractions branch Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.