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

index de3b3cfe..98fae3ed 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts
@@ -295,6 +295,8 @@ export async function onIdentify(this: WebSocket, data: Payload) { ...new ReadyGuildDTO(x).toJSON(), guild_hashes: {}, joined_at: x.joined_at, + name: x.name, + icon: x.icon, }; }), guild_experiments: [], // TODO diff --git a/src/gateway/opcodes/LazyRequest.ts b/src/gateway/opcodes/LazyRequest.ts
index 3cc2b655..64e50d92 100644 --- a/src/gateway/opcodes/LazyRequest.ts +++ b/src/gateway/opcodes/LazyRequest.ts
@@ -26,6 +26,7 @@ import { LazyRequestSchema, User, Presence, + partition, } from "@spacebar/util"; import { WebSocket, @@ -302,11 +303,3 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { }, }); } - -/* https://stackoverflow.com/a/50636286 */ -function partition<T>(array: T[], filter: (elem: T) => boolean) { - const pass: T[] = [], - fail: T[] = []; - array.forEach((e) => (filter(e) ? pass : fail).push(e)); - return [pass, fail]; -}