patch
This commit is contained in:
@@ -490,9 +490,32 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
||||
guilds.filter((guild) => !guild.unavailable) as Guild[]
|
||||
).map((guild) => {
|
||||
return {
|
||||
voice_states: guild.voice_states.map((state) =>
|
||||
state.toPublicVoiceState(),
|
||||
),
|
||||
voice_states: guild.voice_states.map((state) => {
|
||||
if (typeof state.toPublicVoiceState === "function") {
|
||||
return state.toPublicVoiceState();
|
||||
} else {
|
||||
console.log("Returning non-standard voice state");
|
||||
return {
|
||||
user_id: state.user_id,
|
||||
suppress: state.suppress,
|
||||
session_id: state.session_id,
|
||||
self_video: state.self_video,
|
||||
self_mute: state.self_mute,
|
||||
self_deaf: state.self_deaf,
|
||||
self_stream: state.self_stream ?? false,
|
||||
request_to_speak_timestamp:
|
||||
state.request_to_speak_timestamp
|
||||
? new Date(
|
||||
state.request_to_speak_timestamp,
|
||||
).toISOString()
|
||||
: null,
|
||||
mute: state.mute,
|
||||
deaf: state.deaf,
|
||||
channel_id: state.channel_id,
|
||||
guild_id: state.guild_id,
|
||||
};
|
||||
}
|
||||
}),
|
||||
id: guild.id,
|
||||
embedded_activities: [],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user