-
Notifications
You must be signed in to change notification settings - Fork 861
Closed
Labels
Description
Hey!
I love the module and everything works perfectly but the begin option. I just can't seem to get it working. As I couldn't find similiar issues, I might think that it's my code. The video always starts playing at 0:00, no matter what time format I try to supply. I work with discord.js. Hope someone can help, thanks in advance!
const tagID = message.author.tag.split('#', 2);
if (tagID[1] == '6133' || tagID[1] == '0219') {
const [command, youtubeLink, beginTime] = Util.splitWithTail(message.content, " ", 2);
const voiceChannel = message.member.voiceChannel;
voiceChannel.join().then((connection) => {
const stream = ytdl(youtubeLink, {
filter : 'audioonly',
begin : (beginTime === null) ? '0:00' : beginTime
});
const dispatcher = connection.playStream(stream);
dispatcher.on('end', () => {
message.delete();
connection.disconnect();
});
}).catch((error) => {
console.log("[ YT PLAYBACK ERROR ] " + error);
});
}