diff --git a/src/config/types.discord.ts b/src/config/types.discord.ts index 70ea5f1fb..debd5afb5 100644 --- a/src/config/types.discord.ts +++ b/src/config/types.discord.ts @@ -148,6 +148,21 @@ export type DiscordAccountConfig = { execApprovals?: DiscordExecApprovalConfig; /** Privileged Gateway Intents (must also be enabled in Discord Developer Portal). */ intents?: DiscordIntentsConfig; + /** Bot presence/status configuration. */ + presence?: DiscordPresenceConfig; +}; + +export type DiscordPresenceConfig = { + /** Enable presence updates after each message. Default: false. */ + enabled?: boolean; + /** Show cumulative token usage in status. Default: false. */ + showTokenUsage?: boolean; + /** Custom format string for status text. Placeholders: {tokens}, {input}, {output}, {model}, {provider}, {session}. */ + format?: string; + /** Activity type. Bots cannot use "Custom" - that's user accounts only. Default: "Watching". */ + activityType?: "Playing" | "Watching" | "Listening" | "Competing"; + /** Bot online status. Default: "online". */ + status?: "online" | "idle" | "dnd" | "invisible"; }; export type DiscordConfig = { diff --git a/src/discord/monitor/presence-manager.ts b/src/discord/monitor/presence-manager.ts index 1192999ed..4f9323d71 100644 --- a/src/discord/monitor/presence-manager.ts +++ b/src/discord/monitor/presence-manager.ts @@ -31,11 +31,11 @@ export type PresenceContext = { // Note: Bots CANNOT use type 4 (Custom) - that's user-only // Available for bots: Playing (0), Streaming (1), Listening (2), Watching (3), Competing (5) const ACTIVITY_TYPE_MAP: Record = { - Playing: 0, // "Playing {name}" - Streaming: 1, // "Streaming {name}" - Listening: 2, // "Listening to {name}" - Watching: 3, // "Watching {name}" - Competing: 5, // "Competing in {name}" + Playing: 0, // "Playing {name}" + Streaming: 1, // "Streaming {name}" + Listening: 2, // "Listening to {name}" + Watching: 3, // "Watching {name}" + Competing: 5, // "Competing in {name}" }; // Track cumulative tokens per session