Files
lettabot/lettabot.example.yaml
Cameron f5371a9ba7 feat: add group gating to Telegram, Discord, and Slack (#258) (#265)
WhatsApp and Signal already had groups config with requireMention and
group allowlists. This brings the same pattern to the remaining three
channels, giving operators consistent control over which groups the bot
participates in and whether mentions are required.

- New `groups` config for Telegram, Discord, Slack (per-group allowlist
  with requireMention, wildcard support)
- Telegram: standalone gating module with entity, text, command, and
  regex mention detection; applied to text, voice, and attachment handlers
- Discord: inline gating using native message.mentions API
- Slack: gating in message handler (drops non-mentions) and app_mention
  handler (allowlist check); helper methods on adapter
- Signal: pass wasMentioned through to InboundMessage (was detected but
  never forwarded)
- Config wiring: groups/mentionPatterns forwarded from main.ts to all
  adapter constructors
- 17 new tests for Telegram gating

Written by Cameron ◯ Letta Code

"Even in the group chat of life, sometimes you gotta be @mentioned
to know the universe is talking to you." — Ancient Internet Proverb
2026-02-10 14:47:19 -08:00

76 lines
2.6 KiB
YAML

# LettaBot Configuration
# Copy this to lettabot.yaml and fill in your values.
#
# Server modes:
# - 'cloud': Use Letta Cloud (api.letta.com) with API key
# - 'selfhosted': Use self-hosted Letta server
server:
mode: cloud
# For cloud mode, set your API key (get one at https://app.letta.com):
apiKey: sk-let-YOUR-API-KEY
# For selfhosted mode, uncomment and set the base URL:
# mode: selfhosted
# baseUrl: http://localhost:8283
agent:
name: LettaBot
# displayName: "💜 Signo" # Prefix outbound messages (useful in multi-agent group chats)
# Note: model is configured on the Letta agent server-side.
# Select a model during `lettabot onboard` or change it with `lettabot model set <handle>`.
# BYOK Providers (optional, cloud mode only)
# These will be synced to Letta Cloud on startup
# providers:
# - id: anthropic
# name: lc-anthropic
# type: anthropic
# apiKey: sk-ant-YOUR-ANTHROPIC-KEY
# - id: openai
# name: lc-openai
# type: openai
# apiKey: sk-YOUR-OPENAI-KEY
channels:
telegram:
enabled: true
token: YOUR-TELEGRAM-BOT-TOKEN
dmPolicy: pairing # 'pairing', 'allowlist', or 'open'
# groupPollIntervalMin: 5 # Batch interval for group messages (default: 10)
# instantGroups: ["-100123456"] # Groups that bypass batching
# listeningGroups: ["-100123456"] # Groups where bot observes but only replies when @mentioned
# Group access control (which groups can interact, mention requirement):
# groups:
# "*": { requireMention: true } # Default: only respond when @mentioned
# "-1001234567890": { requireMention: false } # This group gets all messages
# mentionPatterns: ["hey bot"] # Additional regex patterns for mention detection
# slack:
# enabled: true
# appToken: xapp-...
# botToken: xoxb-...
# listeningGroups: ["C0123456789"] # Channels where bot observes only
# # groups:
# # "*": { requireMention: true } # Default: only respond when @mentioned
# # "C0123456789": { requireMention: false }
# discord:
# enabled: true
# token: YOUR-DISCORD-BOT-TOKEN
# listeningGroups: ["1234567890123456789"] # Server/channel IDs where bot observes only
# # groups:
# # "*": { requireMention: true } # Default: only respond when @mentioned
# # "1234567890123456789": { requireMention: false } # Server or channel ID
# whatsapp:
# enabled: true
# selfChat: false
features:
cron: false
heartbeat:
enabled: false
intervalMin: 30
# Attachment handling (defaults to 20MB if omitted)
# attachments:
# maxMB: 20
# maxAgeDays: 14