Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make !warn fail if DMing the user is unsuccessful #3073

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

vivekashok1221
Copy link
Member

@vivekashok1221 vivekashok1221 commented May 24, 2024

Closes #1352

I've made it so that !warn will fail if the user has their DMs disabled (or has blocked the bot) AND the command was invoked in a "private" channel which the user does not have access to.

image

Comment on lines +255 to +256
confirm_msg = (f":x: Failed to apply **warning** to {user.mention} "
"because DMing the user was unsuccessful")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to changing this to something else like "Failed to apply warning to @mention because the user has their DMs disabled".
I chose the current message because I felt it accounted for cases where users block the bot too, but I realize the distinction is irrelevant.

Copy link
Member

@mbaruh mbaruh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested

bot/exts/moderation/infraction/_scheduler.py Show resolved Hide resolved
@wookie184 wookie184 added the s: needs review Author is waiting for someone to review and approve label Jun 11, 2024
@ChrisLovering ChrisLovering merged commit 7469fd8 into main Jul 8, 2024
5 checks passed
@ChrisLovering ChrisLovering deleted the vivek/warn-dm-fail branch July 8, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: needs review Author is waiting for someone to review and approve
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning infractions in mod channels should fail if the user has DMs off
5 participants