Optionaloptions: SpeechOptions<T>Optionalgroup?: stringGroup identifier, use it if you pass group to joinVoiceChannel
https://discord.js.org/docs/packages/voice/main/JoinVoiceChannelOptions:Interface#group
OptionalignoreBots?: booleanDon't listen to other bots. Defaults to true
Optionalkey?: stringOptionallang?: stringLanguage of the speech, for example en-US or pl-PL. Defaults to en-US
OptionalmaximalVoiceMessageDuration?: numberMaximal length of a single voice message, in seconds. Longer speech is split into multiple voice messages.
Defaults to 19, because Google Speech and wit.ai reject longer audio. Raise it if your speech recognition function can handle more.
OptionalminimalVoiceMessageDuration?: numberMinimal length of voice message that will be processed, in seconds. Defaults to 1
OptionalprofanityFilter?: booleanReplaces vulgar words with asterisks. Defaults to true
OptionalshouldProcessSpeech?: (user: User, connection: VoiceConnection) => booleanCustom handler to decide whether to recognize speech. It is called when the user starts speaking: if it returns false, the audio isn't recorded or sent anywhere.
OptionalsilenceDuration?: numberHow long the user has to be silent before the voice message ends, in milliseconds. Defaults to 300
OptionalspeechRecognition?: ((audioBuffer: Buffer, options?: GoogleSpeechV2Options) => Promise<string>) | T
Main function, use this to add new events to present discord.Client
Defaults uses
en-USlanguage 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: