Trim Discord config to supported keys
Browse files- setup-hf-config.mjs +0 -15
setup-hf-config.mjs
CHANGED
|
@@ -378,9 +378,6 @@ const discordNativeCommands = parseBoolean(process.env.OPENCLAW_DISCORD_NATIVE_C
|
|
| 378 |
const discordIntents = Number.parseInt(process.env.OPENCLAW_DISCORD_INTENTS?.trim() || "", 10);
|
| 379 |
const discordDmPolicy = process.env.OPENCLAW_DISCORD_DM_POLICY?.trim();
|
| 380 |
const discordAllowFrom = parseCsv(process.env.OPENCLAW_DISCORD_ALLOW_FROM?.trim());
|
| 381 |
-
const discordGuildPolicy = process.env.OPENCLAW_DISCORD_GUILD_POLICY?.trim();
|
| 382 |
-
const discordGuildAllowFrom = parseCsv(process.env.OPENCLAW_DISCORD_GUILD_ALLOW_FROM?.trim());
|
| 383 |
-
const discordRequireMention = parseBoolean(process.env.OPENCLAW_DISCORD_REQUIRE_MENTION);
|
| 384 |
const discordProxy = process.env.OPENCLAW_DISCORD_PROXY?.trim();
|
| 385 |
const discordConfigRequested = Boolean(discordBotToken) || hasEnvPrefix("OPENCLAW_DISCORD_");
|
| 386 |
const geminiCliAuthEnabled = parseBoolean(process.env.OPENCLAW_ENABLE_GEMINI_CLI_AUTH) ?? true;
|
|
@@ -552,15 +549,6 @@ if (discordConfigRequested) {
|
|
| 552 |
if (Number.isFinite(discordIntents)) config.channels.discord.intents = discordIntents;
|
| 553 |
if (discordDmPolicy) config.channels.discord.dmPolicy = discordDmPolicy;
|
| 554 |
if (discordAllowFrom.length > 0) config.channels.discord.allowFrom = discordAllowFrom;
|
| 555 |
-
if (discordGuildPolicy) config.channels.discord.guildPolicy = discordGuildPolicy;
|
| 556 |
-
if (discordGuildAllowFrom.length > 0) {
|
| 557 |
-
config.channels.discord.guildAllowFrom = discordGuildAllowFrom;
|
| 558 |
-
}
|
| 559 |
-
if (discordRequireMention !== undefined) {
|
| 560 |
-
if (!config.channels.discord.guilds) config.channels.discord.guilds = {};
|
| 561 |
-
if (!config.channels.discord.guilds["*"]) config.channels.discord.guilds["*"] = {};
|
| 562 |
-
config.channels.discord.guilds["*"].requireMention = discordRequireMention;
|
| 563 |
-
}
|
| 564 |
if (discordProxy) config.channels.discord.proxy = discordProxy;
|
| 565 |
} else {
|
| 566 |
// OpenClaw auto-starts Discord when DISCORD_BOT_TOKEN exists unless enabled is explicitly false.
|
|
@@ -570,9 +558,6 @@ if (discordConfigRequested) {
|
|
| 570 |
delete config.channels.discord.intents;
|
| 571 |
delete config.channels.discord.dmPolicy;
|
| 572 |
delete config.channels.discord.allowFrom;
|
| 573 |
-
delete config.channels.discord.guildPolicy;
|
| 574 |
-
delete config.channels.discord.guildAllowFrom;
|
| 575 |
-
delete config.channels.discord.guilds;
|
| 576 |
delete config.channels.discord.proxy;
|
| 577 |
discordConfigState = "disabled";
|
| 578 |
}
|
|
|
|
| 378 |
const discordIntents = Number.parseInt(process.env.OPENCLAW_DISCORD_INTENTS?.trim() || "", 10);
|
| 379 |
const discordDmPolicy = process.env.OPENCLAW_DISCORD_DM_POLICY?.trim();
|
| 380 |
const discordAllowFrom = parseCsv(process.env.OPENCLAW_DISCORD_ALLOW_FROM?.trim());
|
|
|
|
|
|
|
|
|
|
| 381 |
const discordProxy = process.env.OPENCLAW_DISCORD_PROXY?.trim();
|
| 382 |
const discordConfigRequested = Boolean(discordBotToken) || hasEnvPrefix("OPENCLAW_DISCORD_");
|
| 383 |
const geminiCliAuthEnabled = parseBoolean(process.env.OPENCLAW_ENABLE_GEMINI_CLI_AUTH) ?? true;
|
|
|
|
| 549 |
if (Number.isFinite(discordIntents)) config.channels.discord.intents = discordIntents;
|
| 550 |
if (discordDmPolicy) config.channels.discord.dmPolicy = discordDmPolicy;
|
| 551 |
if (discordAllowFrom.length > 0) config.channels.discord.allowFrom = discordAllowFrom;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 552 |
if (discordProxy) config.channels.discord.proxy = discordProxy;
|
| 553 |
} else {
|
| 554 |
// OpenClaw auto-starts Discord when DISCORD_BOT_TOKEN exists unless enabled is explicitly false.
|
|
|
|
| 558 |
delete config.channels.discord.intents;
|
| 559 |
delete config.channels.discord.dmPolicy;
|
| 560 |
delete config.channels.discord.allowFrom;
|
|
|
|
|
|
|
|
|
|
| 561 |
delete config.channels.discord.proxy;
|
| 562 |
discordConfigState = "disabled";
|
| 563 |
}
|