Discord VC: voice channels, transcription, and TTS (#18774)

This commit is contained in:
Shadow
2026-02-20 16:06:07 -06:00
committed by GitHub
parent 3100b77f12
commit 4ab946eebf
23 changed files with 1924 additions and 1076 deletions

View File

@@ -434,6 +434,12 @@ export const FIELD_HELP: Record<string, string> = {
"channels.discord.maxLinesPerMessage": "Soft max line count per Discord message (default: 17).",
"channels.discord.ui.components.accentColor":
"Accent color for Discord component containers (hex). Set per account via channels.discord.accounts.<id>.ui.components.accentColor.",
"channels.discord.voice.enabled":
"Enable Discord voice channel conversations (default: true). Omit channels.discord.voice to keep voice support disabled for the account.",
"channels.discord.voice.autoJoin":
"Voice channels to auto-join on startup (list of guildId/channelId entries).",
"channels.discord.voice.tts":
"Optional TTS overrides for Discord voice playback (merged with messages.tts).",
"channels.discord.intents.presence":
"Enable the Guild Presences privileged intent. Must also be enabled in the Discord Developer Portal. Allows tracking user activities (e.g. Spotify). Default: false.",
"channels.discord.intents.guildMembers":

View File

@@ -291,6 +291,8 @@ export const FIELD_LABELS: Record<string, string> = {
"channels.discord.ui.components.accentColor": "Discord Component Accent Color",
"channels.discord.intents.presence": "Discord Presence Intent",
"channels.discord.intents.guildMembers": "Discord Guild Members Intent",
"channels.discord.voice.enabled": "Discord Voice Enabled",
"channels.discord.voice.autoJoin": "Discord Voice Auto-Join",
"channels.discord.pluralkit.enabled": "Discord PluralKit Enabled",
"channels.discord.pluralkit.token": "Discord PluralKit Token",
"channels.discord.activity": "Discord Presence Activity",

View File

@@ -11,6 +11,7 @@ import type {
import type { ChannelHeartbeatVisibilityConfig } from "./types.channels.js";
import type { DmConfig, ProviderCommandsConfig } from "./types.messages.js";
import type { GroupToolPolicyBySenderConfig, GroupToolPolicyConfig } from "./types.tools.js";
import type { TtsConfig } from "./types.tts.js";
export type DiscordStreamMode = "partial" | "block" | "off";
@@ -94,6 +95,22 @@ export type DiscordIntentsConfig = {
guildMembers?: boolean;
};
export type DiscordVoiceAutoJoinConfig = {
/** Guild ID that owns the voice channel. */
guildId: string;
/** Voice channel ID to join. */
channelId: string;
};
export type DiscordVoiceConfig = {
/** Enable Discord voice channel conversations (default: true). */
enabled?: boolean;
/** Voice channels to auto-join on startup. */
autoJoin?: DiscordVoiceAutoJoinConfig[];
/** Optional TTS overrides for Discord voice output. */
tts?: TtsConfig;
};
export type DiscordExecApprovalConfig = {
/** Enable exec approval forwarding to Discord DMs. Default: false. */
enabled?: boolean;
@@ -211,6 +228,8 @@ export type DiscordAccountConfig = {
ui?: DiscordUiConfig;
/** Privileged Gateway Intents (must also be enabled in Discord Developer Portal). */
intents?: DiscordIntentsConfig;
/** Voice channel conversation settings. */
voice?: DiscordVoiceConfig;
/** PluralKit identity resolution for proxied messages. */
pluralkit?: DiscordPluralKitConfig;
/** Outbound response prefix override for this channel/account. */

View File

@@ -21,6 +21,7 @@ import {
ProviderCommandsSchema,
ReplyToModeSchema,
RetryConfigSchema,
TtsConfigSchema,
requireOpenAllowFrom,
} from "./zod-schema.core.js";
import { sensitive } from "./zod-schema.sensitive.js";
@@ -271,6 +272,22 @@ const DiscordUiSchema = z
.strict()
.optional();
const DiscordVoiceAutoJoinSchema = z
.object({
guildId: z.string().min(1),
channelId: z.string().min(1),
})
.strict();
const DiscordVoiceSchema = z
.object({
enabled: z.boolean().optional(),
autoJoin: z.array(DiscordVoiceAutoJoinSchema).optional(),
tts: TtsConfigSchema.optional(),
})
.strict()
.optional();
export const DiscordAccountSchema = z
.object({
name: z.string().optional(),
@@ -347,6 +364,7 @@ export const DiscordAccountSchema = z
})
.strict()
.optional(),
voice: DiscordVoiceSchema,
pluralkit: z
.object({
enabled: z.boolean().optional(),