summary refs log tree commit diff
path: root/src/opcodes/LazyRequest.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 04:07:32 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 04:07:32 +0200
commit6b61c86e3fc828454742587e768f5aaca167b64c (patch)
tree2defaadd927bcf4b2e73e899641ed31bb1cebe3f /src/opcodes/LazyRequest.ts
parent:sparkles: Ready event (diff)
downloadserver-6b61c86e3fc828454742587e768f5aaca167b64c.tar.xz
:art: add opcodes
Diffstat (limited to 'src/opcodes/LazyRequest.ts')
-rw-r--r--src/opcodes/LazyRequest.ts28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/opcodes/LazyRequest.ts b/src/opcodes/LazyRequest.ts
new file mode 100644

index 00000000..accff8de --- /dev/null +++ b/src/opcodes/LazyRequest.ts
@@ -0,0 +1,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 }], + }, + }); +}