mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
fix: VoiceState#member nullable (#995)
* fix(types/voice): member field in VoiceState is nullable
* member is optional for live stages
* Update JSDoc comment block for VoiceState#member
* Revert "member is optional for live stages"
This reverts commit 2faa8b129b.
* feat(handlers/voice): add voiceLurkerJoin event
This commit is contained in:
@@ -9,6 +9,9 @@ export async function handleVoiceStateUpdate(data: DiscordGatewayPayload) {
|
||||
const payload = data.d as VoiceState;
|
||||
if (!payload.guildId) return;
|
||||
|
||||
// The "member" field in the payload is `null` if the user is in a live stage but not in the guild.
|
||||
if (payload.member === null) return eventHandlers.voiceLurkerJoin?.(payload);
|
||||
|
||||
const guild = await cacheHandlers.get("guilds", snowflakeToBigint(payload.guildId));
|
||||
if (!guild) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user