{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "properties": { "connection": { "type": "string", "enum": [ "gateway", "interactions" ], "default": "gateway", "description": "Gateway WebSocket (default). interactions uses httpHostToken POST + Ed25519 verify." }, "intents": { "type": "array", "items": { "type": "number" } }, "enableSlashCommands": { "type": "boolean", "default": false }, "globalCommands": { "type": "boolean", "default": false }, "defaultActivity": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "type": { "type": "string", "enum": [ "PLAYING", "STREAMING", "LISTENING", "WATCHING", "COMPETING" ] }, "url": { "type": "string" } }, "required": [ "name", "type" ] }, "slashCommands": { "type": "array", "items": { "type": "object" } }, "applicationId": { "type": "string", "description": "Required when connection is interactions." }, "publicKey": { "type": "string", "description": "Required when connection is interactions (hex Ed25519 public key)." }, "interactionsPath": { "type": "string", "default": "/discord/interactions", "description": "POST path on httpHostToken when connection is interactions." }, "endpoints": { "type": "array", "minItems": 1, "description": "多账号:每项定义一个 endpoint,id/token 必填,其余字段覆盖实例默认值", "items": { "type": "object", "additionalProperties": false, "properties": { "token": { "type": "string", "description": "Discord bot token" }, "connection": { "type": "string", "enum": [ "gateway", "interactions" ] }, "intents": { "type": "array", "items": { "type": "number" } }, "enableSlashCommands": { "type": "boolean" }, "globalCommands": { "type": "boolean" }, "defaultActivity": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "type": { "type": "string", "enum": [ "PLAYING", "STREAMING", "LISTENING", "WATCHING", "COMPETING" ] }, "url": { "type": "string" } }, "required": [ "name", "type" ] }, "slashCommands": { "type": "array", "items": { "type": "object" } }, "applicationId": { "type": "string" }, "publicKey": { "type": "string" }, "interactionsPath": { "type": "string" }, "commandPrefix": { "type": "string" }, "id": { "type": "string", "description": "Discord bot name" }, "gatewayFaultProxyUrl": { "type": "string", "pattern": "^(?:ws://127\\.0\\.0\\.1:[0-9]+/?|\\$\\{[A-Za-z_][A-Za-z0-9_]*\\})$", "description": "Isolated acceptance only: loopback Gateway fault proxy; REST unchanged." }, "restApiProxy": { "type": "object", "additionalProperties": false, "properties": { "port": { "type": "integer", "minimum": 1, "maximum": 65535 } }, "required": [ "port" ], "description": "Gateway测试实例REST专用故障代理:discord.com:443固定loopback TCP,保留SNI/证书校验,独立于Gateway代理", "x-i18n": { "en": { "description": "REST-only fault proxy for Gateway tests: pin discord.com:443 TCP to loopback while preserving SNI and certificate validation, independently of the Gateway proxy." } } }, "nickname": { "type": [ "string", "null" ], "description": "账号昵称兜底", "x-i18n": { "en": { "description": "Fallback account nickname" } } }, "profile": { "$ref": "#/$defs/selfProfileFallback", "description": "账号资料兜底", "x-i18n": { "en": { "description": "Fallback account profile" } } } }, "required": [ "id", "token" ] }, "x-i18n": { "en": { "description": "Multiple accounts: each entry defines an endpoint. id and token are required; other fields override instance defaults." } } }, "commandPrefix": { "type": "string", "default": "", "description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖", "x-i18n": { "en": { "description": "Command prefix. The default empty string allows unprefixed commands; '/' requires a leading slash. Each endpoints[i] can override it." } } }, "gatewayFaultProxyUrl": { "type": "string", "pattern": "^(?:ws://127\\.0\\.0\\.1:[0-9]+/?|\\$\\{[A-Za-z_][A-Za-z0-9_]*\\})$", "description": "Isolated acceptance only: loopback Gateway fault proxy; REST unchanged." }, "nickname": { "type": [ "string", "null" ], "description": "账号昵称兜底", "x-i18n": { "en": { "description": "Fallback account nickname" } } }, "profile": { "$ref": "#/$defs/selfProfileFallback", "description": "账号资料兜底", "x-i18n": { "en": { "description": "Fallback account profile" } } } }, "required": [ "endpoints" ], "$defs": { "selfProfileFallback": { "type": "object", "additionalProperties": false, "properties": { "gender": { "type": [ "string", "null" ], "enum": [ "male", "female", "other", "unknown", null ] }, "age": { "type": [ "integer", "null" ], "minimum": 0 }, "birthday": { "type": [ "string", "null" ], "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$" }, "signature": { "type": [ "string", "null" ] }, "avatar": { "type": [ "string", "null" ], "pattern": "^(https?://[^\\s/?#]+(?:[/?#].*)?|)$" }, "interests": { "type": [ "array", "null" ], "items": { "type": "string" } }, "bio": { "type": [ "string", "null" ] } } } } }