• Main function, use this to add new events to present discord.Client

    Defaults uses en-US language and google speech v2 api with generic key, that should be used for personal or testing purposes only, as it may be revoked by Google at any time.
    You can obtain your own API key here http://www.chromium.org/developers/how-tos/api-keys.
    See python speech recognition package for more details.


    Example usage:

    const client = new Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_VOICE_STATES],
    });
    // You can modify speechOptions object to change how things work
    const speechOptions = addSpeechEvent(client, { lang: "pl-PL" });

    Type Parameters

    Parameters

    Returns { group?: string; ignoreBots?: boolean; key?: string; lang?: string; minimalVoiceMessageDuration?: number; profanityFilter?: boolean; shouldProcessSpeech?: ((user: User) => boolean); speechRecognition?: ((audioBuffer: Buffer, options?: GoogleSpeechV2Options) => Promise<string>) }

    • Optional group?: string
    • Optional ignoreBots?: boolean

      Defaults to true

    • Optional key?: string
    • Optional lang?: string
    • Optional minimalVoiceMessageDuration?: number

      Minimal length of voice message that will be processed

    • Optional profanityFilter?: boolean
    • Optional shouldProcessSpeech?: ((user: User) => boolean)
        • (user: User): boolean
        • Custom handler to decide whether to recognize speech

          Returns

          Parameters

          • user: User

            The user who spoke

          Returns boolean

    • Optional speechRecognition?: ((audioBuffer: Buffer, options?: GoogleSpeechV2Options) => Promise<string>)
        • (audioBuffer: Buffer, options?: GoogleSpeechV2Options): Promise<string>
        • Performs speech recognition using the Google Speech Recognition API V2

          Returns

          Recognized text from speech

          Parameters

          Returns Promise<string>

Generated using TypeDoc