Member Junction
    Preparing search index...

    The minimal Discord voice-channel / bot-gateway surface the import('./discord-bridge').DiscordBridge depends on. Production binds this to @discordjs/voice + discord.js; tests inject a FakeDiscordVoiceSdk.

    No hand-raise / no scheduled-invite operations — see the file-level note: Discord is voice-channel based and surfaces no hand-raise, so this seam deliberately omits them. It DOES keep postChatMessage (Discord text channels), unlike the Google Meet seam.

    interface IDiscordVoiceSdk {
        getMembers(): Promise<DiscordMember[]>;
        joinVoiceChannel(args: DiscordJoinArgs): Promise<DiscordJoinResult>;
        leaveVoiceChannel(): Promise<void>;
        muteMember(userId: string): Promise<void>;
        onAudioFrame(cb: (frame: DiscordAudioFrame) => void): void;
        onDisconnect(cb: () => void): void;
        onMemberJoin(cb: (member: DiscordMember) => void): void;
        onMemberLeave(cb: (userId: string) => void): void;
        postChatMessage(text: string): Promise<void>;
        sendAudioFrame(pcm: ArrayBuffer): void;
    }

    Implemented by

    Index

    Methods

    • Mutes a member in the voice channel (requires the bot to have the guild's "Mute Members" permission).

      Parameters

      • userId: string

        The user to mute.

      Returns Promise<void>

    • Registers a callback fired when the bot's voice connection is dropped (channel deleted, kicked, gateway disconnect). "Latest handler wins."

      Parameters

      • cb: () => void

        Invoked when the voice connection has ended.

      Returns void

    • Registers a callback fired when a member leaves the voice channel. "Latest handler wins."

      Parameters

      • cb: (userId: string) => void

        Invoked with the user id that left.

      Returns void

    • Posts a message to the associated text channel (everyone in the channel sees it). Discord exposes a first-class programmatic text-channel post, so this is supported (unlike Google Meet).

      Parameters

      • text: string

        The chat message text.

      Returns Promise<void>

    • Sends one raw PCM audio frame as the bot's outbound audio (the agent's voice into the channel). The adapter encodes to Opus for the Discord voice connection.

      Parameters

      • pcm: ArrayBuffer

        The PCM audio bytes to send.

      Returns void