more cleanup

This commit is contained in:
Skillz
2020-03-10 19:09:14 -04:00
parent 7dcd1de7de
commit fcc24020a4
5 changed files with 16 additions and 52 deletions

View File

@@ -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)
}

View File

@@ -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<Action> {
@@ -58,4 +58,4 @@ export class RatelimitedActionQueue extends ActionQueue<DiscordPayload> {
shouldDispatchImmediately () {
return this.lastRatelimitDetails?.limit !== 0;
}
}
}

View File

@@ -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"

View File

@@ -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 {

12
types/presence.ts Normal file
View File

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