diff --git a/src/client.ts b/src/client.ts index 0f66402..21374c5 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,6 +1,7 @@ import { DiscordIPC, PacketIPCEvent } from "./conn.ts"; import type { Activity, + ActivityType, ApplicationPayload, AuthenticateResponsePayload, ChannelPayload, @@ -95,7 +96,7 @@ export class Client { */ setActivity(activity?: Activity) { return this.ipc!.sendCommand< - Activity & { application_id: string; type: number } + Activity & { application_id: string; type: ActivityType } >( "SET_ACTIVITY", { diff --git a/src/types.ts b/src/types.ts index 77e7c64..2d99d96 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,6 +1,7 @@ // deno-lint-ignore-file camelcase export interface Activity { + type?: ActivityType; details?: string; state?: string; assets?: { @@ -28,6 +29,15 @@ export interface Activity { }[]; } +export enum ActivityType { + PLAYING, + STREAMING, + LISTENING, + WATCHING, + CUSTOM, + COMPETING, +} + export enum OpCode { HANDSHAKE, FRAME,