summary refs log tree commit diff
path: root/src/Schema/Identify.ts
blob: 3a7182dbbf40816cd40062f0d7ad63199ef8fbd3 (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
29
30
31
32
33
import { ActivitySchema } from "./Activity";

export const 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,
};

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;
}