feat: add discord reaction tool

This commit is contained in:
Peter Steinberger
2026-01-02 00:29:32 +01:00
parent 9180cbe821
commit 7f3113b8d4
7 changed files with 94 additions and 4 deletions

View File

@@ -179,7 +179,8 @@ Configure the Discord bot by setting the bot token and optional gating:
},
requireMention: true, // require @bot mentions in guilds
mediaMaxMb: 8, // clamp inbound media size
historyLimit: 20 // include last N guild messages as context
historyLimit: 20, // include last N guild messages as context
enableReactions: false // allow agent-triggered reactions
}
}
```

View File

@@ -24,6 +24,7 @@ Status: ready for DM and guild text channels via the official Discord bot gatewa
7. Optional DM allowlist: reuse `discord.allowFrom` with user ids (`1234567890` or `discord:1234567890`). Use `"*"` to allow all DMs.
8. Optional guild allowlist: set `discord.guildAllowFrom` with `guilds` and/or `users` to gate who can invoke the bot in servers.
9. Optional guild context history: set `discord.historyLimit` (default 20) to include the last N guild messages as context when replying to a mention. Set `0` to disable.
10. Optional reactions: set `discord.enableReactions = true` to allow the agent to react to Discord messages via the `clawdis_discord` tool.
Note: Discord does not provide a simple username → id lookup without extra guild context, so prefer ids or `<@id>` mentions for DM delivery targets.
@@ -47,7 +48,8 @@ Note: Discord does not provide a simple username → id lookup without extra gui
},
requireMention: true,
mediaMaxMb: 8,
historyLimit: 20
historyLimit: 20,
enableReactions: false
}
}
```
@@ -57,6 +59,14 @@ Note: Discord does not provide a simple username → id lookup without extra gui
- `requireMention`: when `true`, messages in guild channels must mention the bot.
- `mediaMaxMb`: clamp inbound media saved to disk.
- `historyLimit`: number of recent guild messages to include as context when replying to a mention (default 20, `0` disables).
- `enableReactions`: allow agent-triggered reactions via the `clawdis_discord` tool (default `false`).
## Reactions
When `discord.enableReactions = true`, the agent can call `clawdis_discord` with:
- `action: "react"`
- `channelId`, `messageId`, `emoji`
Discord message ids are surfaced in the injected context (`[discord message id: …]` and history lines) so the agent can target them.
## Safety & ops
- Treat the bot token like a password; prefer the `DISCORD_BOT_TOKEN` env var on supervised hosts or lock down the config file permissions.