This commit is contained in:
NoLogicAlan committed 2026-09-13 02:30:47 +03:00
1 parent cc0b438ef6
commit 207c60ceec
5 files changed
+133 -74

No files matched your search

+15 -11
View File
@@ -65,19 +65,23 @@ export function hasHumansInChannel({ guildId, channelId, client, voiceCache, obs
}
if (observedVoiceUsers) {
try {
const iterator = typeof observedVoiceUsers.iterateHumanUsers === "function"
? observedVoiceUsers.iterateHumanUsers()
: observedVoiceUsers.entries();
if (observedVoiceUsers && observedVoiceUsers !== voiceCache) {
if (typeof observedVoiceUsers.hasHumansInChannel === "function") {
if (observedVoiceUsers.hasHumansInChannel(guildId, channelId)) return true;
} else {
try {
const iterator = typeof observedVoiceUsers.iterateHumanUsers === "function"
? observedVoiceUsers.iterateHumanUsers()
: observedVoiceUsers.entries();
for (const [, info] of iterator) {
const gId = String(info.guildId ?? "");
const cId = String(info.channelId ?? "");
if (gId === guildId && cId === channelId) return true;
for (const [, info] of iterator) {
const gId = String(info.guildId ?? "");
const cId = String(info.channelId ?? "");
if (gId === guildId && cId === channelId) return true;
}
} catch (e) {
logger.warn("[VoiceStateResolver] ObservedVoiceUsers check failed:", e?.message);
}
} catch (e) {
logger.warn("[VoiceStateResolver] ObservedVoiceUsers check failed:", e?.message);
}
}