fix(discord): Add DiscordPresenceConfig type definition and fix formatting

- Add missing TypeScript type for presence config (fixes TS2339)
- Fix oxfmt formatting in presence-manager.ts
This commit is contained in:
Johnathon Selstad 2026-01-26 14:42:33 -08:00
parent c624ff3098
commit dd465ce1a6
2 changed files with 20 additions and 5 deletions

View File

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

View File

@ -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<string, number> = {
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