Add the Presence payload type

This commit is contained in:
Will Hoskings
2020-02-11 18:24:10 +00:00
parent 1d989094d5
commit 655df25d57
+44
View File
@@ -0,0 +1,44 @@
import { UserPayload } from "./user.ts";
import { ActivityPayload } from "./activity";
import { StatusType } from "../types/discord";
export type PresencePayload = Partial<{
/** The user presence is being updated for */
user: UserPayload;
/** 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: ClientStatusPayload;
/** 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 ClientStatusPayload {
/** 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;
}