addSpeechEvent< T > ( client: Client < boolean > , options?: SpeechOptions < T > ) : { group?: string ; ignoreBots?: boolean ; key?: string ; lang?: string ; minimalVoiceMessageDuration?: number ; profanityFilter?: boolean ; shouldProcessSpeech?: ( ( user: User ) => boolean ) ; speechRecognition?: ( ( audioBuffer: Buffer , options?: GoogleSpeechV2Options ) => Promise < string > ) }
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
Optional key?: string
Optional lang?: string
Optional minimalVoiceMessageDuration?: number
Optional profanityFilter?: boolean
Optional shouldProcessSpeech?: ( ( user: User ) => boolean )
( user: User ) : boolean
Returns boolean
Optional speechRecognition?: ( ( audioBuffer: Buffer , options?: GoogleSpeechV2Options ) => Promise < string > )
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: