mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 11:14:46 +00:00
fix(discord): tune gateway intents and metadata timeout
This commit is contained in:
@@ -792,6 +792,11 @@ export const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA = [
|
||||
proxy: {
|
||||
type: "string",
|
||||
},
|
||||
gatewayInfoTimeoutMs: {
|
||||
type: "integer",
|
||||
exclusiveMinimum: 0,
|
||||
maximum: 120000,
|
||||
},
|
||||
allowBots: {
|
||||
anyOf: [
|
||||
{
|
||||
@@ -1445,6 +1450,9 @@ export const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA = [
|
||||
guildMembers: {
|
||||
type: "boolean",
|
||||
},
|
||||
voiceStates: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
@@ -2147,6 +2155,11 @@ export const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA = [
|
||||
proxy: {
|
||||
type: "string",
|
||||
},
|
||||
gatewayInfoTimeoutMs: {
|
||||
type: "integer",
|
||||
exclusiveMinimum: 0,
|
||||
maximum: 120000,
|
||||
},
|
||||
allowBots: {
|
||||
anyOf: [
|
||||
{
|
||||
@@ -2800,6 +2813,9 @@ export const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA = [
|
||||
guildMembers: {
|
||||
type: "boolean",
|
||||
},
|
||||
voiceStates: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
@@ -3521,9 +3537,17 @@ export const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA = [
|
||||
label: "Discord Guild Members Intent",
|
||||
help: "Enable the Guild Members privileged intent. Must also be enabled in the Discord Developer Portal. Default: false.",
|
||||
},
|
||||
"intents.voiceStates": {
|
||||
label: "Discord Voice States Intent",
|
||||
help: "Enable the Guild Voice States intent. Defaults to the effective Discord voice setting; set false for text-only gateway sessions even when voice config is present.",
|
||||
},
|
||||
gatewayInfoTimeoutMs: {
|
||||
label: "Discord Gateway Metadata Timeout (ms)",
|
||||
help: "Timeout for Discord /gateway/bot metadata lookup before falling back to the default gateway URL. Default is 30000; OPENCLAW_DISCORD_GATEWAY_INFO_TIMEOUT_MS can override when config is unset.",
|
||||
},
|
||||
"voice.enabled": {
|
||||
label: "Discord Voice Enabled",
|
||||
help: "Enable Discord voice channel conversations (default: true). Omit channels.discord.voice to keep voice support disabled for the account.",
|
||||
help: "Enable Discord voice channel conversations (default: true). Set false for text-only gateway sessions.",
|
||||
},
|
||||
"voice.model": {
|
||||
label: "Discord Voice Model",
|
||||
|
||||
@@ -116,6 +116,8 @@ export type DiscordIntentsConfig = {
|
||||
presence?: boolean;
|
||||
/** Enable Guild Members privileged intent (requires Portal opt-in). Default: false. */
|
||||
guildMembers?: boolean;
|
||||
/** Enable Guild Voice States intent. Defaults to voice.enabled, unless explicitly set. */
|
||||
voiceStates?: boolean;
|
||||
};
|
||||
|
||||
export type DiscordVoiceAutoJoinConfig = {
|
||||
@@ -241,6 +243,8 @@ export type DiscordAccountConfig = {
|
||||
token?: SecretInput;
|
||||
/** HTTP(S) proxy URL for Discord gateway WebSocket connections. */
|
||||
proxy?: string;
|
||||
/** Timeout for Discord /gateway/bot metadata lookup before falling back to the default gateway URL. Default: 30000. */
|
||||
gatewayInfoTimeoutMs?: number;
|
||||
/** Allow bot-authored messages to trigger replies (default: false). Set "mentions" to gate on mentions. */
|
||||
allowBots?: boolean | "mentions";
|
||||
/**
|
||||
|
||||
@@ -528,6 +528,7 @@ export const DiscordAccountSchema = z
|
||||
configWrites: z.boolean().optional(),
|
||||
token: SecretInputSchema.optional().register(sensitive),
|
||||
proxy: z.string().optional(),
|
||||
gatewayInfoTimeoutMs: z.number().int().positive().max(120_000).optional(),
|
||||
allowBots: z.union([z.boolean(), z.literal("mentions")]).optional(),
|
||||
dangerouslyAllowNameMatching: z.boolean().optional(),
|
||||
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
||||
@@ -613,6 +614,7 @@ export const DiscordAccountSchema = z
|
||||
.object({
|
||||
presence: z.boolean().optional(),
|
||||
guildMembers: z.boolean().optional(),
|
||||
voiceStates: z.boolean().optional(),
|
||||
})
|
||||
.strict()
|
||||
.optional(),
|
||||
|
||||
Reference in New Issue
Block a user