summary refs log tree commit diff
path: root/src/Schema
diff options
context:
space:
mode:
Diffstat (limited to 'src/Schema')
-rw-r--r--src/Schema/Activity.ts40
-rw-r--r--src/Schema/Emoji.ts8
-rw-r--r--src/Schema/Identify.ts16
3 files changed, 63 insertions, 1 deletions
diff --git a/src/Schema/Activity.ts b/src/Schema/Activity.ts

index e502cebd..00772743 100644 --- a/src/Schema/Activity.ts +++ b/src/Schema/Activity.ts
@@ -39,3 +39,43 @@ export const ActivitySchema = { ], $since: Number, // unix time (in milliseconds) of when the client went idle, or null if the client is not idle }; + +export interface ActivitySchema { + afk: boolean; + status: string; + activities?: [ + { + name: string; // the activity's name + type: number; // activity type // TODO: check if its between range 0-5 + url?: string; // stream url, is validated when type is 1 + created_at?: number; // unix timestamp of when the activity was added to the user's session + timestamps?: { + // unix timestamps for start and/or end of the game + start: number; + end: number; + }; + application_id?: bigint; // application id for the game + details?: string; + State?: string; + emoji?: EmojiSchema; + party?: { + id?: string; + size?: [number]; // used to show the party's current and maximum size // TODO: array length 2 + }; + assets?: { + large_image?: string; // the id for a large asset of the activity, usually a snowflake + large_text?: string; // text displayed when hovering over the large image of the activity + small_image?: string; // the id for a small asset of the activity, usually a snowflake + small_text?: string; // text displayed when hovering over the small image of the activity + }; + secrets?: { + join?: string; // the secret for joining a party + spectate?: string; // the secret for spectating a game + match?: string; // the secret for a specific instanced match + }; + instance?: boolean; + flags: bigint; // activity flags OR d together, describes what the payload includes + } + ]; + since?: number; // unix time (in milliseconds) of when the client went idle, or null if the client is not idle +} diff --git a/src/Schema/Emoji.ts b/src/Schema/Emoji.ts
index ebb9afdd..09f3ebb1 100644 --- a/src/Schema/Emoji.ts +++ b/src/Schema/Emoji.ts
@@ -1,5 +1,11 @@ export const EmojiSchema = { name: String, // the name of the emoji - id: BigInt, // the id of the emoji + $id: BigInt, // the id of the emoji animated: Boolean, // whether this emoji is animated }; + +export interface EmojiSchema { + name: string; + id?: bigint; + animated: Boolean; +} diff --git a/src/Schema/Identify.ts b/src/Schema/Identify.ts
index 8775fac3..3a7182db 100644 --- a/src/Schema/Identify.ts +++ b/src/Schema/Identify.ts
@@ -15,3 +15,19 @@ export const IdentifySchema = { $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; +}