Add the ability to pause & unpause DMs #196
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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:
...and unpause them:
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.
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.