summary refs log tree commit diff
path: root/gateway/src
diff options
context:
space:
mode:
Diffstat (limited to 'gateway/src')
-rw-r--r--gateway/src/opcodes/Identify.ts10
-rw-r--r--gateway/src/schema/VoiceStateUpdateSchema.ts8
2 files changed, 10 insertions, 8 deletions
diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts

index eb15c28f..860000da 100644 --- a/gateway/src/opcodes/Identify.ts +++ b/gateway/src/opcodes/Identify.ts
@@ -29,8 +29,8 @@ const experiments: any = []; import { check } from "./instanceOf"; import { Recipient } from "@fosscord/util"; -// TODO: bot sharding -// TODO: check priviliged intents +// TODO: user sharding +// TODO: check privileged intents, if defined in the config // TODO: check if already identified export async function onIdentify(this: WebSocket, data: Payload) { @@ -87,7 +87,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { user_id: this.user_id, session_id: session_id, // TODO: check if status is only one of: online, dnd, offline, idle - status: identify.presence?.status || "online", //does the session always start as online? + status: identify.presence?.status || "offline", //does the session always start as online? client_info: { //TODO read from identity client: "desktop", @@ -101,7 +101,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { if (!user) return this.close(CLOSECODES.Authentication_failed); - if (!identify.intents) identify.intents = BigInt("0b11111111111111"); + if (!identify.intents) identify.intents = BigInt("0x6ffffffff"); this.intents = new Intents(identify.intents); if (identify.shard) { this.shard_id = identify.shard[0]; @@ -271,7 +271,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { guild_join_requests: [], // TODO what is this? users: users.filter((x) => x).unique(), merged_members: merged_members, - // shard // TODO: only for bots sharding + // shard // TODO: only for user sharding }; // TODO: send real proper data structure diff --git a/gateway/src/schema/VoiceStateUpdateSchema.ts b/gateway/src/schema/VoiceStateUpdateSchema.ts
index 9efa191e..f6480414 100644 --- a/gateway/src/schema/VoiceStateUpdateSchema.ts +++ b/gateway/src/schema/VoiceStateUpdateSchema.ts
@@ -3,7 +3,8 @@ export const VoiceStateUpdateSchema = { $channel_id: String, self_mute: Boolean, self_deaf: Boolean, - self_video: Boolean, + $self_video: Boolean, //required in docs but bots don't always send it + $preferred_region: String, }; export interface VoiceStateUpdateSchema { @@ -11,5 +12,6 @@ export interface VoiceStateUpdateSchema { channel_id?: string; self_mute: boolean; self_deaf: boolean; - self_video: boolean; -} + self_video?: boolean; + preferred_region?: string; +} \ No newline at end of file