Commit Graph

13 Commits

Author SHA1 Message Date
Johnathon Selstad
c624ff3098 feat(discord): Add bot presence/status updates with token usage tracking
Integrates presence updates directly into the Discord channel integration:

- Added presence config schema (channels.discord.presence):
  - enabled: Toggle presence updates
  - showTokenUsage: Show cumulative token count
  - format: Custom format string with placeholders ({tokens}, {model}, etc.)
  - activityType: Playing, Watching, Listening, Competing (NOT Custom - bots can't use it)
  - status: online, idle, dnd, invisible

- Created PresenceManager in src/discord/monitor/presence-manager.ts:
  - Tracks cumulative token usage per session
  - Formats status text with configurable placeholders
  - Interfaces with Carbon GatewayPlugin.updatePresence()

- Created presence registry (src/discord/presence-registry.ts):
  - Shared registry for presence managers across accounts
  - Exported via plugin-sdk for extension access

- Wired up message_sent hook in Discord extension:
  - Hook triggers after each reply is delivered
  - Updates bot presence with session token counts

Config example:
```json5
channels: {
  discord: {
    presence: {
      enabled: true,
      showTokenUsage: true,
      format: "📊 {tokens} tokens",
      activityType: "Watching",  // Shows: "Watching 📊 1,234 tokens"
      status: "online"
    }
  }
}
```

Note: Discord API limitation - bots cannot use Custom activity type (type 4).
Available types: Playing, Watching, Listening, Competing.
2026-01-26 14:31:47 -08:00
Peter Steinberger
8f6542409a chore: bump versions for 2026.1.25 2026-01-25 22:13:04 +00:00
Peter Steinberger
a22ac64c47 chore: release 2026.1.24-1 2026-01-25 14:08:20 +00:00
Adam Holt
c07949a99c Channels: add per-group tool policies 2026-01-24 05:49:39 +00:00
Peter Steinberger
4ee70be690 chore: bump version to 2026.1.23 2026-01-23 22:14:56 +00:00
Peter Steinberger
3993c9a3b4 fix: stop BlueBubbles typing on idle/no-reply (#1439) (thanks @Nicell) 2026-01-22 21:33:19 +00:00
Peter Steinberger
3ad0d2fe23 chore: bump version to 2026.1.21 2026-01-22 01:59:16 +00:00
Peter Steinberger
cb7791c8a4 chore: release 2026.1.20-2 2026-01-21 08:30:33 +00:00
Peter Steinberger
bc8a59faa4 chore: release 2026.1.20-1 2026-01-21 07:37:22 +00:00
Shadow
2f6d5805de fix: enforce plugin config schemas (#1272) (thanks @thewilloftheshadow)
Co-authored-by: thewilloftheshadow <thewilloftheshadow@users.noreply.github.com>
2026-01-20 11:03:17 +00:00
Peter Steinberger
d1e9490f95 fix: enforce strict config validation 2026-01-19 03:39:25 +00:00
Peter Steinberger
ee6e534ccb refactor: route channel runtime via plugin api 2026-01-18 11:01:16 +00:00
Peter Steinberger
c5e19f5c67 refactor: migrate messaging plugins to sdk 2026-01-18 08:54:00 +00:00