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

Add the ability to pause & unpause DMs #196

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

FloatingMilkshake
Copy link
Collaborator

This PR closes #182.

Adds the ability to pause and unpause DMs. This is the same as pausing DMs from a server's "Security Actions" menu:
image

Because of D#+ limitations, the bot sends manual HTTP requests to Discord's API. It feels a bit hacky, but it works!

'Classic' message commands and slash commands are both added, to both pause DMs:
image
...and unpause them:
image
image

The commands fail with a warning if an invalid time is provided when attempting to pause DMs, or if DMs are already unpaused when attempting to unpause them.
image

The slash commands are limited to moderators only (i.e. not trial moderators). Because of limitations, they are restricted with the 'Moderate Members' permission, so they will be visible to trial moderators, but unusable.
image

@FloatingMilkshake FloatingMilkshake requested a review from Erisa June 15, 2024 02:52
Commands/InteractionCommands/SecurityActionInteractions.cs Outdated Show resolved Hide resolved
Commands/InteractionCommands/SecurityActionInteractions.cs Outdated Show resolved Hide resolved
Commands/InteractionCommands/SecurityActionInteractions.cs Outdated Show resolved Hide resolved
Commands/SecurityActions.cs Outdated Show resolved Hide resolved
Commands/SecurityActions.cs Outdated Show resolved Hide resolved
Helpers/SecurityActionHelpers.cs Outdated Show resolved Hide resolved
Helpers/SecurityActionHelpers.cs Outdated Show resolved Hide resolved
FloatingMilkshake and others added 2 commits June 19, 2024 11:19
Co-authored-by: Erisa A <erisa@erisa.uk>
@FloatingMilkshake FloatingMilkshake requested a review from Erisa June 19, 2024 15:54
@FloatingMilkshake FloatingMilkshake merged commit 8a1d8f8 into main Jun 19, 2024
2 checks passed
@FloatingMilkshake FloatingMilkshake deleted the floatingmilkshake/pause-dms branch June 19, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Todo: Pause DMs command
2 participants