Fix timestamp 3rd edition

helps to supply ytdl arguments to, you know, ytdl
This commit is contained in:
Robert 2022-06-11 02:17:08 -07:00
parent ed28d27738
commit 4b71fe1b02

2
bot.js
View File

@ -165,7 +165,7 @@ client.on('message', async message => {
// Play the video as requested // Play the video as requested
try { try {
//TODO: process the timestamp with ffmpeg or whatever //TODO: process the timestamp with ffmpeg or whatever
const dispatcher = connection.play(await ytdl(yturl), { type: 'opus', volume: volume, begin: timestamp}); const dispatcher = connection.play(await ytdl(yturl, { begin: timestamp }), { type: 'opus', volume: volume});
dispatcher.on('start', () => { console.log(`Playing ${yturl}`); }); dispatcher.on('start', () => { console.log(`Playing ${yturl}`); });
dispatcher.on('finish', () => { console.log(`Finished ${yturl}`); }); dispatcher.on('finish', () => { console.log(`Finished ${yturl}`); });
dispatcher.on('error', console.error); dispatcher.on('error', console.error);