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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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
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
3 participants