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 option for default duration of mutes #216

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Usoka
Copy link
Contributor

@Usoka Usoka commented May 14, 2021

Allow users to set a default duration for all mutes (including automod) when a time is not specified. Set via default_duration: Nullable<tDelayString> in mutes config. Default/null is indefinite mute.

Notes:

  • I don't have a full test setup currently. So can't thoroughly test (e.g. mass mute and automod mutes)
  • Applies to all mutes. Could be changed to just apply to manual mutes? Though then would be best to move to mod actions.
  • If a user tries to mute an already muted user without specifying a length it will update the mute to the default. This mirrors how it currently works with indefinite mutes.

Comment on lines +56 to +60
muteTime = muteTime !== undefined
? muteTime
: config.default_duration
? convertDelayStringToMS(config.default_duration)!
: undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
muteTime = muteTime !== undefined
? muteTime
: config.default_duration
? convertDelayStringToMS(config.default_duration)!
: undefined;
muteTime ??= config.default_duration
? convertDelayStringToMS(config.default_duration)!
: undefined;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants