openclaw/extensions/discord-status/clawdbot.plugin.json
Johnathon Selstad 93757f92e3 feat(hooks): Wire up message_sent hook with usage statistics
- Extended PluginHookMessageSentEvent to include usage stats (tokens, model, provider, duration)
- Extended PluginHookMessageContext to include sessionKey and agentId
- Wired up runMessageSent hook call in dispatch-from-config.ts after final replies
- Added discord-status example plugin demonstrating how to use the hook

The message_sent hook now fires after each reply is delivered, enabling plugins to:
- Track token usage across sessions
- Update external status indicators (e.g., Discord bot presence)
- Log message delivery for analytics/monitoring

Note: Full Discord presence support requires exposing setPresence via PluginRuntime.
The example plugin currently logs the status it would set.
2026-01-26 14:20:50 -08:00

43 lines
1.1 KiB
JSON

{
"id": "discord-status",
"name": "Discord Status",
"version": "0.1.0",
"description": "Updates Discord bot status with session context usage after each message",
"author": "Clawdbot Contributors",
"homepage": "https://github.com/clawdbot/clawdbot",
"entrypoint": "./index.ts",
"configSchema": {
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable Discord status updates"
},
"format": {
"type": "string",
"description": "Status format string. Use {tokens} for token count.",
"default": "📊 {tokens} tokens"
},
"activityType": {
"type": "string",
"enum": ["Playing", "Watching", "Listening", "Competing", "Custom"],
"description": "Discord activity type",
"default": "Custom"
}
}
},
"uiHints": {
"enabled": {
"label": "Enable Status Updates"
},
"format": {
"label": "Status Format",
"placeholder": "📊 {tokens} tokens"
},
"activityType": {
"label": "Activity Type"
}
}
}