forked from Supositware/Haha-Yes
testing fix
This commit is contained in:
parent
3d93d3d3c4
commit
f797af8bf8
1 changed files with 15 additions and 14 deletions
|
@ -37,20 +37,21 @@ class dectalkvcCommand extends Command {
|
||||||
},
|
},
|
||||||
}).then(async (result) => {
|
}).then(async (result) => {
|
||||||
const outputFilename = './dectalkvc.wav';
|
const outputFilename = './dectalkvc.wav';
|
||||||
fs.writeFileSync(outputFilename, result.data);
|
fs.writeFileSync(outputFilename, result.data)
|
||||||
|
.then(async () => {
|
||||||
const voiceChannel = message.member.voice.channel;
|
const voiceChannel = message.member.voice.channel;
|
||||||
if (!voiceChannel) return message.say('Please enter a voice channel first.');
|
if (!voiceChannel) return message.say('Please enter a voice channel first.');
|
||||||
try {
|
try {
|
||||||
const connection = await voiceChannel.join();
|
const connection = await voiceChannel.join();
|
||||||
const dispatcher = connection.play('./dectalkvc.wav');
|
const dispatcher = connection.play('./dectalkvc.wav');
|
||||||
dispatcher.once('finish', () => voiceChannel.leave());
|
dispatcher.once('finish', () => voiceChannel.leave());
|
||||||
dispatcher.once('error', () => voiceChannel.leave());
|
dispatcher.once('error', () => voiceChannel.leave());
|
||||||
return null;
|
return null;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
voiceChannel.leave();
|
voiceChannel.leave();
|
||||||
return message.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return message.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue