This commit is contained in:
loicbersier 2019-05-20 00:23:15 +02:00
parent fc4f96908a
commit 8527f1f319
4 changed files with 7 additions and 6 deletions

4
.gitignore vendored
View file

@ -29,8 +29,8 @@ ttsvc.mp3
music.mp3
dectalk.wav
dectalkvc.wav
sam.mp3
samvc.mp3
sam.wav
samvc.wav
# json

View file

@ -72,9 +72,9 @@ class samCommand extends Command {
'Content-Type': 'audio/mpeg',
},
}).then((result) => {
const outputFilename = './sam.mp3';
const outputFilename = './sam.wav';
fs.writeFileSync(outputFilename, result.data);
return message.channel.send({files: ['./sam.mp3']});
return message.channel.send({files: ['./sam.wav']});
});
}

View file

@ -72,14 +72,15 @@ class samvcCommand extends Command {
'Content-Type': 'audio/mpeg',
},
}).then(async (result) => {
const outputFilename = './samvc.mp3';
const outputFilename = './samvc.wav';
fs.writeFile(outputFilename, result.data, async function(err) {
if (err) console.error(err);
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.say('Please enter a voice channel first.');
try {
const connection = await voiceChannel.join();
const dispatcher = connection.play('./dectalkvc.wav');
const dispatcher = connection.play('./samvc.wav');
dispatcher.once('finish', () => voiceChannel.leave());
dispatcher.once('error', () => voiceChannel.leave());
return null;

BIN
sam.mp3 Normal file

Binary file not shown.