Skip to content

Infraction DMs fail for all bans/kicks due to order change #982

@SebastiaanZ

Description

@SebastiaanZ

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.

Metadata

Metadata

Assignees

Labels

a: moderationRelated to community moderation functionality: (moderation, defcon, verification)p: 0 - criticalNeeds to be addressed ASAPt: bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions