moderation: dm user before taking action

This commit is contained in:
seth 2023-12-13 11:51:53 -05:00
parent 3e3be2aed5
commit 9dce57f527
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86

View file

@ -121,21 +121,21 @@ impl<T: ModActionInfo> ModAction<T> {
dm_user: Option<bool>, dm_user: Option<bool>,
handle_reply: bool, handle_reply: bool,
) -> Result<()> { ) -> Result<()> {
let actual_reason = self.reason.clone().unwrap_or("".to_string());
self.data.run_action(ctx, user, actual_reason).await?;
if quiet.unwrap_or_default() { if quiet.unwrap_or_default() {
ctx.defer_ephemeral().await?; ctx.defer_ephemeral().await?;
} else { } else {
ctx.defer().await?; ctx.defer().await?;
} }
self.log_action(ctx).await?; let actual_reason = self.reason.clone().unwrap_or("".to_string());
if dm_user.unwrap_or_default() { if dm_user.unwrap_or_default() {
self.dm_user(ctx, user).await?; self.dm_user(ctx, user).await?;
} }
self.data.run_action(ctx, user, actual_reason).await?;
self.log_action(ctx).await?;
if handle_reply { if handle_reply {
self.reply(ctx, user, dm_user).await?; self.reply(ctx, user, dm_user).await?;
} }