chore: bug fix cleanup (#4)

This commit is contained in:
hampus-fluxer
2026-01-03 06:44:40 +01:00
committed by GitHub
parent 275126d61b
commit c9c5dceb47
80 changed files with 4639 additions and 3709 deletions

View File

@@ -95,7 +95,22 @@ class VoiceStateManager {
this.gatewayHandler.handleGuildDelete(deletedGuildId);
}
getCurrentUserVoiceState(guildId?: string | null, currentUserId?: string): VoiceState | null {
getCurrentUserVoiceState(
guildId?: string | null,
currentUserId?: string,
connectionId?: string | null,
): VoiceState | null {
const requestedGuildKey = guildId ?? ME;
if (connectionId) {
const byConnection = this.connectionVoiceStates[connectionId];
if (byConnection) {
if (!guildId || byConnection.guild_id === requestedGuildKey) {
return byConnection;
}
}
}
if (!currentUserId) {
logger.debug('[VoiceStateManager] Cannot get current user voice state: no user ID provided');
return null;