Merge pull request #2 from sravanth-chebrolu/fix-bot-not-recording

Potential fix for #1
This commit is contained in:
Sravanth C 2020-09-10 13:48:02 +05:30 committed by GitHub
commit 3b54fbc6e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -11,7 +11,7 @@ const appendChunkToFile = (fileName) => {
client.on('message', msg => {
if (msg.content.startsWith(config.PREFIX)) {
const commandBody = msg.content.split(config.PREFIX)[1].split(' ');
const commandBody = msg.content.substring(config.PREFIX.length).split(' ');
const channelName = commandBody[1];
if (commandBody[0] === ('enter') && commandBody[1] && commandBody[2]) {
@ -23,7 +23,12 @@ client.on('message', msg => {
console.log(`Sliding into ${voiceChannel.name}...`);
voiceChannel.join()
.then(conn => {
const dispatcher = conn.play('./sounds/ding.mp3');
dispatcher.on('start', () => { console.log('ding.mp3 is playing..'); });
dispatcher.on('finish', () => { console.log('ding.mp3 has finished playing..'); });
console.log(`Joined ${voiceChannel.name}!\n\nREADY TO RECORD\n`);
const receiver = conn.receiver;
conn.on('speaking', (user, speaking) => {
if (speaking) {

BIN
sounds/ding.mp3 Normal file

Binary file not shown.