How do I write a `isVoiceChannelEmpty` function?

export function isVoiceChannelEmpty(
channel: GuildBasedChannel,
): boolean {
return channel.members.size === 0;
}
export function isVoiceChannelEmpty(
channel: GuildBasedChannel,
): boolean {
return channel.members.size === 0;
}
In previous versions, the code I wrote above would be how to find out if a voice channel was empty. However, this code no longer works in the latest version. How can I write this function?
4 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Zamiel
ZamielOP3y ago
My version is 14.6.0.
Zamiel
ZamielOP3y ago
Zamiel
ZamielOP3y ago
Is there a ThreadMemberManage identity function provided so that I can type narrow? Well, GuildBasedChannel is the return type of the guild.channels.fetch(channelID) method. I guess I should instead fetch only voice channels? Ah, perfect, that's the identity function I was looking for, thank you.
Want results from more Discord servers?
Add your server