From caafbc606ce722f3afaa72ead4a2c28f8fbbe5e2 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Wed, 10 Feb 2021 22:04:55 +0100 Subject: move Schema from util to gateway --- src/schema/Identify.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/schema/Identify.ts (limited to 'src/schema/Identify.ts') diff --git a/src/schema/Identify.ts b/src/schema/Identify.ts new file mode 100644 index 00000000..cfc3702a --- /dev/null +++ b/src/schema/Identify.ts @@ -0,0 +1,33 @@ +import { ActivitySchema } from "./Activity"; + +export const IdentifySchema = { + token: String, + intents: BigInt, // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt + $properties: { + // bruh discord really uses $ in the property key, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key + $$os: String, + $$browser: String, + $$device: String, + }, + $presence: ActivitySchema, + $compress: Boolean, + $large_threshold: Number, + $shard: [Number], + $guild_subscriptions: Boolean, +}; + +export interface IdentifySchema { + token: string; + properties: { + // bruh discord really uses $ in the property key, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key + $$os: string; + $$browser: string; + $$device: string; + }; + intents: bigint; // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt + presence?: ActivitySchema; + compress?: boolean; + large_threshold?: number; + shard?: [number]; + guild_subscriptions?: boolean; +} -- cgit 1.5.1