3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

fix: timeout mutes always being applied for 28d

They were still being removed by the bot after the real mute time,
but the native timeout was always set to 28d.
This commit is contained in:
Dragory 2023-04-01 23:04:30 +03:00
parent c136c117d2
commit 0e58301dc8
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -7,7 +7,7 @@ import { MAX_TIMEOUT_DURATION } from "../../../data/Mutes";
* @return - Timeout expiry timestamp
*/
export function getTimeoutExpiryTime(muteExpiresAt: number | null | undefined): number {
if (muteExpiresAt && muteExpiresAt <= MAX_TIMEOUT_DURATION) {
if (muteExpiresAt && muteExpiresAt - Date.now() <= MAX_TIMEOUT_DURATION) {
return muteExpiresAt;
}
return Date.now() + MAX_TIMEOUT_DURATION;