new play changes
This commit is contained in:
BIN
[object Undefined]
Normal file
BIN
[object Undefined]
Normal file
Binary file not shown.
Binary file not shown.
@@ -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 => {
|
||||||
|
|||||||
Reference in New Issue
Block a user