From 6bdded4360e7d7edb1193cd4b59a349a552700a9 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 28 Aug 2025 13:20:51 -0400 Subject: [PATCH] VoiceJoinMessages: Fix Empty String --- src/equicordplugins/voiceJoinMessages/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/equicordplugins/voiceJoinMessages/index.ts b/src/equicordplugins/voiceJoinMessages/index.ts index 8f7d74e1b..845dd6e84 100644 --- a/src/equicordplugins/voiceJoinMessages/index.ts +++ b/src/equicordplugins/voiceJoinMessages/index.ts @@ -10,7 +10,7 @@ import { humanFriendlyJoin } from "@utils/text"; import definePlugin, { OptionType } from "@utils/types"; import { Message, User } from "@vencord/discord-types"; import { findByCodeLazy } from "@webpack"; -import { ChannelStore, FluxDispatcher, MessageActions, MessageStore, RelationshipStore, SelectedChannelStore, UserStore, VoiceStateStore } from "@webpack/common"; +import { ChannelStore, FluxDispatcher, MessageActions, MessageStore, RelationshipStore, SelectedChannelStore, UserStore } from "@webpack/common"; const createBotMessage = findByCodeLazy('username:"Clyde"'); @@ -126,12 +126,12 @@ export default definePlugin({ const selfInChannel = SelectedChannelStore.getVoiceChannelId() === channelId; let memberListContent = ""; if (settings.store.friendDirectMessagesShowMembers || settings.store.friendDirectMessagesShowMemberCount) { - const voiceState = VoiceStateStore.getVoiceStatesForChannel(channelId); - const sortedVoiceStates: User[] = Object.values(voiceState as { [key: string]: VoiceState; }) - .filter((voiceState: VoiceState) => { voiceState.user && voiceState.user.id !== userId; }) - .map((voiceState: VoiceState) => voiceState.user); - console.log(sortedVoiceStates); - const otherMembers = sortedVoiceStates.filter(s => s.id !== userId); + const users = Object.values(voiceStates) + .filter(vs => vs.channelId === channelId) + .map(vs => UserStore.getUser(vs.userId)) + .filter(user => user != null); + + const otherMembers = users.filter(s => s.id !== userId); const otherMembersCount = otherMembers.length; if (otherMembersCount <= 0) { memberListContent += ", nobody else is in the voice channel";