From fcc24020a4e3ccc5a8f5af12e056b4d6a06b960d Mon Sep 17 00:00:00 2001 From: Skillz Date: Tue, 10 Mar 2020 19:09:14 -0400 Subject: [PATCH] more cleanup --- structures/presence.ts | 48 ------------------------------------------ structures/queue.ts | 4 ++-- types/discord.ts | 2 +- types/guild.ts | 2 +- types/presence.ts | 12 +++++++++++ 5 files changed, 16 insertions(+), 52 deletions(-) delete mode 100644 structures/presence.ts create mode 100644 types/presence.ts diff --git a/structures/presence.ts b/structures/presence.ts deleted file mode 100644 index 7f9266e96..000000000 --- a/structures/presence.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { ActivityPayload } from "../types/activity.ts" -import { StatusType } from "../types/discord.ts" -import { User_Payload } from "../types/guild.ts" - -export type PresencePayload = Partial<{ - /** The user presence is being updated for */ - user: User_Payload - - /** Roles this user is in */ - roles: string[] - - /** Null, or the user's current activity */ - game: ActivityPayload - - /** Id of the guild */ - guild_id: string - - // This is a deviation from the docs, as it pretty much says `: StatusType`. - /** The updated status */ - status: StatusType - - /** User's current activities */ - activities: ActivityPayload[] - - /** User's platform-dependent status */ - client_status: Client_Status_Payload - - /** When the user used their Nitro boost on the server */ - premium_since: string - - /** This users guild nickname (if one is set) */ - nick: string -}> & { id: string } - -export interface Client_Status_Payload { - /** The user's status set for an active desktop (Windows, Linux, Mac) application session */ - desktop?: StatusType - - /** The user's status set for an active mobile (iOS, Android) application session */ - mobile?: StatusType - - /** The user's status set for an active web (browser, bot account) application session */ - web?: StatusType -} - -export const createPresence = (data: unknown) => { - console.log(data) -} diff --git a/structures/queue.ts b/structures/queue.ts index f8004ad68..eae35db1d 100644 --- a/structures/queue.ts +++ b/structures/queue.ts @@ -1,4 +1,4 @@ -import { DiscordPayload } from "../types/discord"; +import { DiscordPayload } from "../types/discord.ts"; import Gateway from "../module/gateway.ts"; export abstract class ActionQueue { @@ -58,4 +58,4 @@ export class RatelimitedActionQueue extends ActionQueue { shouldDispatchImmediately () { return this.lastRatelimitDetails?.limit !== 0; } -} \ No newline at end of file +} diff --git a/types/discord.ts b/types/discord.ts index 1725ccf2e..1df95dd0c 100644 --- a/types/discord.ts +++ b/types/discord.ts @@ -1,5 +1,5 @@ import { Activity } from "./message.ts" -import { Client_Status_Payload } from "../structures/presence.ts" +import { Client_Status_Payload } from "./presence.ts" import { Partial_User } from "./guild.ts" import { Member_Create_Payload } from "./member.ts" diff --git a/types/guild.ts b/types/guild.ts index dc720e697..4b75b853d 100644 --- a/types/guild.ts +++ b/types/guild.ts @@ -4,7 +4,7 @@ import { Permission } from "./permission.ts" import { Role_Data } from "./role.ts" import { Member_Create_Payload } from "./member.ts" import { Activity } from "./message.ts" -import { Client_Status_Payload } from "../structures/presence.ts" +import { Client_Status_Payload } from "./presence.ts" import { Channel_Create_Payload } from "./channel.ts" export interface Guild_Role_Payload { diff --git a/types/presence.ts b/types/presence.ts new file mode 100644 index 000000000..57203a4b5 --- /dev/null +++ b/types/presence.ts @@ -0,0 +1,12 @@ +import { StatusType } from "../types/discord.ts" + +export interface Client_Status_Payload { + /** The user's status set for an active desktop (Windows, Linux, Mac) application session */ + desktop?: StatusType + + /** The user's status set for an active mobile (iOS, Android) application session */ + mobile?: StatusType + + /** The user's status set for an active web (browser, bot account) application session */ + web?: StatusType +}