summary refs log tree commit diff
path: root/src/opcodes/Identify.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-14 18:59:33 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-14 18:59:33 +0100
commitf5269ef39eee21a098679eab121fb3636f460a04 (patch)
treea116a8bd46a0caf783deb5aa9212a1793b53c3e8 /src/opcodes/Identify.ts
parentsetup listeners (diff)
downloadserver-f5269ef39eee21a098679eab121fb3636f460a04.tar.xz
:sparkles: Event dispatching
Diffstat (limited to 'src/opcodes/Identify.ts')
-rw-r--r--src/opcodes/Identify.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/opcodes/Identify.ts b/src/opcodes/Identify.ts

index da993ec8..f62f66b0 100644 --- a/src/opcodes/Identify.ts +++ b/src/opcodes/Identify.ts
@@ -1,9 +1,10 @@ import { CLOSECODES, Payload } from "../util/Constants"; import WebSocket from "../util/WebSocket"; -import { checkToken } from "fosscord-server-util"; +import { checkToken, Intents } from "fosscord-server-util"; import { setupListener } from "../listener/listener"; import { instanceOf } from "lambert-server"; import { IdentifySchema } from "../schema/Identify"; +// TODO: check priviliged intents export async function onIdentify(this: WebSocket, data: Payload) { try { @@ -14,6 +15,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { var decoded = await checkToken(identify.token); this.userid = decoded.id; + this.intents = new Intents(identify.intents); await setupListener.call(this); } catch (error) {