summary refs log tree commit diff
path: root/src/opcodes/LazyRequest.ts
blob: accff8debe53dd429e1c893cefa9fb04d8bb6c11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { CLOSECODES, OPCODES, Payload } from "../util/Constants";
import { Send } from "../util/Send";
import WebSocket from "../util/WebSocket";

export function onLazyRequest(this: WebSocket, { d }: Payload) {
	// TODO: check data
	const { guild_id, typing, channels, activities } = d;

	Send(this, {
		op: OPCODES.Dispatch,
		s: this.sequence++,
		t: "GUILD_MEMBER_LIST_UPDATE",
		d: {
			ops: [
				{
					range: [0, 99],
					op: "SYNC",
					items: [{ group: { id: "online", count: 0 } }],
				},
			],
			online_count: 1,
			member_count: 1,
			id: "everyone",
			guild_id,
			groups: [{ id: "online", count: 1 }],
		},
	});
}