new play changes

This commit is contained in:
Stanislaw
2021-12-27 21:36:50 +01:00
parent cee3c07409
commit 60bf216d71
3 changed files with 6 additions and 5 deletions

BIN
[object Undefined] Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -11,7 +11,7 @@ module.exports = {
let aplay; let aplay;
let queue; let queue;
async function link(msg) { function link(msg) {
let request = msg.content.slice(path.basename(__filename).length + cl.cfg.prefix.length - 3); let request = msg.content.slice(path.basename(__filename).length + cl.cfg.prefix.length - 3);
if (request.trim() == "") { if (request.trim() == "") {
msg.reply("Dej link albo tagi albo weź i spierdalaj"); msg.reply("Dej link albo tagi albo weź i spierdalaj");
@@ -19,9 +19,9 @@ module.exports = {
request = request.trim() request = request.trim()
if (ytdl.validateURL(request)) { if (ytdl.validateURL(request)) {
msg.reply("Poprawny link"); msg.reply("Poprawny link");
link = './sound/' + msg.member.voice.channel.id + '.mp3' let linked = './sound/' + msg.member.voice.channel.id + '.mp4'
await ytdl(request).pipe(fs.createWriteStream(link)); ytdl(request).pipe(fs.createWriteStream(linked));
return link; return linked;
} else { } else {
msg.reply("Kurwo wenecka daj prawdziwy link a nie jaja sobie robisz"); msg.reply("Kurwo wenecka daj prawdziwy link a nie jaja sobie robisz");
} }
@@ -39,7 +39,8 @@ module.exports = {
}) })
} }
aplay = createAudioPlayer(); aplay = createAudioPlayer();
let song = createAudioResource(link(msg)); link(msg);
let song = createAudioResource('./sound/' + msg.member.voice.channel.id + '.mp4');
aplay.play(song); aplay.play(song);
connection.subscribe(aplay); connection.subscribe(aplay);
aplay.on('error', error => { aplay.on('error', error => {