3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00

fix: reapply timeout on join for forcemutes

This commit is contained in:
Dragory 2023-04-01 20:19:17 +03:00
parent 017ef5674a
commit a6750da5da
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -1,7 +1,9 @@
import { Snowflake } from "discord.js";
import moment from "moment-timezone";
import { MuteTypes } from "../../../data/MuteTypes";
import { memberRolesLock } from "../../../utils/lockNameHelpers";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { getTimeoutExpiryTime } from "../functions/getTimeoutExpiryTime";
import { mutesEvt } from "../types";
/**
@ -26,6 +28,12 @@ export const ReapplyActiveMuteOnJoinEvt = mutesEvt({
memberRoleLock.unlock();
}
}
} else {
if (!member.isCommunicationDisabled()) {
const expiresAt = mute.expires_at ? moment.utc(mute.expires_at).valueOf() : null;
const timeoutExpiresAt = getTimeoutExpiryTime(expiresAt);
await member.disableCommunicationUntil(timeoutExpiresAt);
}
}
pluginData.getPlugin(LogsPlugin).logMemberMuteRejoin({