Skip to content

Commit

Permalink
Merge pull request #10 from emthy0/profanity-filter
Browse files Browse the repository at this point in the history
Add profanity options
  • Loading branch information
Rei-x committed Sep 25, 2021
2 parents 1daf491 + 73f549b commit e36a07a
Show file tree
Hide file tree
Showing 8 changed files with 7,942 additions and 182 deletions.
24 changes: 24 additions & 0 deletions examples/simpleBotWithAdvanceConfigurations.js
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');

0 comments on commit e36a07a

Please sign in to comment.