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:
parent
017ef5674a
commit
a6750da5da
1 changed files with 8 additions and 0 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Reference in a new issue