Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add `reason` to infraction message when the actor is the bot itself #476
We recently removed the
However, when an infraction was invoked automatically (e.g., by the
Edit: @MarkKoz is currently doing major work on the moderation cog. To prevent major merge conflicts, I've added the stalled status for now.
Note: Currently, the way the
One way to get around that is to patch the
Examples of before and after
Before the removal of
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, `Context.author` and `Context.message.author` with the bot user.
#476 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