This commit is contained in:
Daniel Odendahl Jr
2018-01-21 16:22:33 +00:00
parent 864ceda8ee
commit ac8fb400df
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -42,8 +42,8 @@ module.exports = class SoundboardCommand extends Command {
if (this.client.voiceConnections.has(channel.guild.id)) return msg.reply('I am already playing a sound.');
try {
const connection = await channel.join();
const dispatcher = connection.playFile(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound]));
dispatcher.once('end', () => channel.leave());
const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound]));
dispatcher.once('finish', () => channel.leave());
dispatcher.once('error', () => channel.leave());
return null;
} catch (err) {
+2 -2
View File
@@ -38,8 +38,8 @@ module.exports = class DECTalkCommand extends Command {
const data = await snekfetch
.get('http://tts.cyzon.us/tts', { followRedirects: false })
.query({ text });
const dispatcher = connection.playArbitraryInput(`http://tts.cyzon.us${data.headers.location}`);
dispatcher.once('end', () => channel.leave());
const dispatcher = connection.play(`http://tts.cyzon.us${data.headers.location}`);
dispatcher.once('finish', () => channel.leave());
dispatcher.once('error', () => channel.leave());
return null;
} catch (err) {