feat: add discord guild wildcard defaults

This commit is contained in:
Peter Steinberger
2026-01-02 22:33:26 +01:00
parent 47f4f59692
commit fd32fc8d8d
6 changed files with 28 additions and 1 deletions

View File

@@ -208,6 +208,7 @@ Configure the Discord bot by setting the bot token and optional gating:
groupChannels: ["clawd-dm"] // optional group DM allowlist
},
guilds: {
"*": { requireMention: true }, // default per-guild mention gating
"123456789012345678": { // guild id (preferred) or slug
slug: "friends-of-clawd",
requireMention: false, // per-guild default
@@ -225,6 +226,7 @@ Configure the Discord bot by setting the bot token and optional gating:
Clawdis starts Discord only when a `discord` config section exists. The token is resolved from `DISCORD_BOT_TOKEN` or `discord.token` (unless `discord.enabled` is `false`). Use `user:<id>` (DM) or `channel:<id>` (guild channel) when specifying delivery targets for cron/CLI commands.
Guild slugs are lowercase with spaces replaced by `-`; channel keys use the slugged channel name (no leading `#`). Prefer guild ids as keys to avoid rename ambiguity.
Use `discord.guilds."*"` for default per-guild settings.
### `imessage` (imsg CLI)

View File

@@ -63,6 +63,7 @@ Note: Guild context `[from:]` lines include `author.tag` + `id` to make ping-rea
groupChannels: ["clawd-dm"]
},
guilds: {
"*": { requireMention: true },
"123456789012345678": {
slug: "friends-of-clawd",
requireMention: false,
@@ -82,6 +83,7 @@ Note: Guild context `[from:]` lines include `author.tag` + `id` to make ping-rea
- `dm.groupEnabled`: enable group DMs (default `false`).
- `dm.groupChannels`: optional allowlist for group DM channel ids or slugs.
- `guilds`: per-guild rules keyed by guild id (preferred) or slug.
- `guilds."*"`: default per-guild settings applied when no explicit entry exists.
- `guilds.<id>.slug`: optional friendly slug used for display names.
- `guilds.<id>.users`: optional per-guild user allowlist (ids or names).
- `guilds.<id>.channels`: channel rules (keys are channel slugs or ids).

View File

@@ -51,6 +51,7 @@ Group messages require a mention unless overridden per group. Defaults live per
Notes:
- `mentionPatterns` are case-insensitive regexes.
- Surfaces that provide explicit mentions still pass; patterns are a fallback.
- Discord defaults live in `discord.guilds."*"` (overridable per guild/channel).
## Activation (owner-only)
Group owners can toggle per-group activation: