-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from emthy0/profanity-filter
Add profanity options
- Loading branch information
Showing
8 changed files
with
7,942 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const {Client} = require('discord.js'); | ||
const {DiscordSR, resolveSpeechWithGoogleSpeechV2} = require('discord-speech-recognition'); | ||
|
||
const client = new Client(); | ||
const discordSR = new DiscordSR(client, { | ||
speechRecognition: resolveSpeechWithGoogleSpeechV2, | ||
speechOptions: { | ||
lang: 'en-US', // RFC5646 language tag; Available language are same as in chromium : `<http://stackoverflow.com/a/14302134>` | ||
// key: 'API_KEY', // API key | ||
profanityFilter: true, // Google profanityFilter | ||
} | ||
}); | ||
|
||
client.on('message', (msg) => { | ||
if (msg.content.startsWith('!join') && msg.member?.voice.channel) { | ||
msg.member.voice.channel.join(); | ||
} | ||
}); | ||
|
||
client.on('speech', (msg) => { | ||
msg.author.send(msg.content); | ||
}); | ||
|
||
client.login('token'); |
Oops, something went wrong.