Skip to content

Commit

Permalink
fix voiceChannelLeave event on no cache
Browse files Browse the repository at this point in the history
  • Loading branch information
urbainn authored and DonovanDMC committed Mar 15, 2024
1 parent b1b19a0 commit cf8e226
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/gateway/Shard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ export default class Shard extends TypedEmitter<ShardEvents> {
this.client.emit("voiceChannelSwitch", member, newChannel, oldChannel);
} else if (newChannel) {
this.client.emit("voiceChannelJoin", member, newChannel);
} else if (oldChannel) {
} else if (state.channelID === null) {
this.client.emit("voiceChannelLeave", member, oldChannel);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/types/events.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export interface ClientEvents {
/** @event Emitted when a user joins a voice channel. Requires the `GUILD_VOICE_STATES` intent. */
voiceChannelJoin: [member: Member, channel: VoiceChannel | StageChannel | Uncached];
/** @event Emitted when a user leaves a voice channel. Requires the `GUILD_VOICE_STATES` intent. */
voiceChannelLeave: [member: Member, channel: VoiceChannel | StageChannel | Uncached];
voiceChannelLeave: [member: Member, channel: VoiceChannel | StageChannel | Uncached | null];
/** @event Emitted when a voice channel's status is updated. Requires the `GUILD_VOICE_STATES` intent. */
voiceChannelStatusUpdate: [channel: VoiceChannel | Uncached, status: string | null];
/** @event Emitted when a user switches voice channels. Requires the `GUILD_VOICE_STATES` intent. */
Expand Down

0 comments on commit cf8e226

Please sign in to comment.