fix wrong if logic again

This commit is contained in:
ITOH
2021-05-23 18:27:33 +02:00
parent 8ca30b813a
commit eb9cb57414

View File

@@ -23,12 +23,7 @@ export async function editMember(guildId: bigint, memberId: bigint, options: Mod
if (options.roles) requiredPerms.add("MANAGE_ROLES");
if (
typeof options.mute !== "undefined" ||
typeof options.deaf !== "undefined" ||
// "object" to do simple null check
(typeof options.channelId !== "undefined" && typeof options.channelId !== "object")
) {
if (options.mute !== undefined || options.deaf !== undefined || options.channelId || options.channelId === null) {
const memberVoiceState = (await cacheHandlers.get("guilds", guildId))?.voiceStates.get(memberId);
if (!memberVoiceState?.channelId) {