In a recent PR, we merged a commit that changed the order in which our members are notified of their infraction and we actually the infraction: Instead of sending the DM first and applying the infraction after, we now apply the infraction first and try to DM the member after.
However, in the case of ban/kick infractions, this means that we try to send a DM to a member that has just been kicked off the server. That will obviously not work, as the bot can only send DMs to users it shares a server with.
This is the commit that changed the order: 32a5bf9
It was merged in PR #864
The reason this change was made was to suppress DMs when we actually fail to apply the infraction on the Discord side. However, we only know if that's going to fail once we've made the request to Discord and we need to send the DM (in the case of kick/ban infractions) before we do that.
I think that we should just change the DM order back to what it was before.
In a recent PR, we merged a commit that changed the order in which our members are notified of their infraction and we actually the infraction: Instead of sending the DM first and applying the infraction after, we now apply the infraction first and try to DM the member after.
However, in the case of ban/kick infractions, this means that we try to send a DM to a member that has just been kicked off the server. That will obviously not work, as the bot can only send DMs to users it shares a server with.
This is the commit that changed the order: 32a5bf9
It was merged in PR #864
The reason this change was made was to suppress DMs when we actually fail to apply the infraction on the Discord side. However, we only know if that's going to fail once we've made the request to Discord and we need to send the DM (in the case of kick/ban infractions) before we do that.
I think that we should just change the DM order back to what it was before.