mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 04:16:06 +00:00
feat(discord): support GOCLAW_DISCORD_TOKEN env var for channel config (#6)
Add env var overlay and auto-enable for Discord channel, matching the existing Telegram pattern. Update .env.example and docker-compose.yml. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f44e86ef2
commit
1b1ca2214a
3 files changed
+6
No files matched your search
@@ -17,6 +17,7 @@ GOCLAW_ENCRYPTION_KEY=
|
||||
|
||||
# --- Channels (optional) ---
|
||||
GOCLAW_TELEGRAM_TOKEN=
|
||||
GOCLAW_DISCORD_TOKEN=
|
||||
|
||||
# --- Database (only for non-Docker deployments) ---
|
||||
# Docker Compose auto-builds this from POSTGRES_USER/PASSWORD/DB.
|
||||
|
||||
@@ -42,6 +42,7 @@ services:
|
||||
- GOCLAW_XAI_API_KEY=${GOCLAW_XAI_API_KEY:-}
|
||||
# Channels
|
||||
- GOCLAW_TELEGRAM_TOKEN=${GOCLAW_TELEGRAM_TOKEN:-}
|
||||
- GOCLAW_DISCORD_TOKEN=${GOCLAW_DISCORD_TOKEN:-}
|
||||
# Debug
|
||||
- GOCLAW_TRACE_VERBOSE=${GOCLAW_TRACE_VERBOSE:-0}
|
||||
volumes:
|
||||
|
||||
@@ -106,6 +106,7 @@ func (c *Config) applyEnvOverrides() {
|
||||
envStr("GOCLAW_PERPLEXITY_API_KEY", &c.Providers.Perplexity.APIKey)
|
||||
envStr("GOCLAW_GATEWAY_TOKEN", &c.Gateway.Token)
|
||||
envStr("GOCLAW_TELEGRAM_TOKEN", &c.Channels.Telegram.Token)
|
||||
envStr("GOCLAW_DISCORD_TOKEN", &c.Channels.Discord.Token)
|
||||
envStr("GOCLAW_ZALO_TOKEN", &c.Channels.Zalo.Token)
|
||||
envStr("GOCLAW_FEISHU_APP_ID", &c.Channels.Feishu.AppID)
|
||||
envStr("GOCLAW_FEISHU_APP_SECRET", &c.Channels.Feishu.AppSecret)
|
||||
@@ -122,6 +123,9 @@ func (c *Config) applyEnvOverrides() {
|
||||
if c.Channels.Telegram.Token != "" {
|
||||
c.Channels.Telegram.Enabled = true
|
||||
}
|
||||
if c.Channels.Discord.Token != "" {
|
||||
c.Channels.Discord.Enabled = true
|
||||
}
|
||||
if c.Channels.Zalo.Token != "" {
|
||||
c.Channels.Zalo.Enabled = true
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user