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
Show the reason in infraction confirmation message if the actor is the bot #504
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.
This PR closes #476
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