From 4b71fe1b02268b733e53e823452efa55b5d9fba4 Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 11 Jun 2022 02:17:08 -0700 Subject: [PATCH] Fix timestamp 3rd edition helps to supply ytdl arguments to, you know, ytdl --- bot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.js b/bot.js index ed1df51..c231c5b 100644 --- a/bot.js +++ b/bot.js @@ -165,7 +165,7 @@ client.on('message', async message => { // Play the video as requested try { //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('finish', () => { console.log(`Finished ${yturl}`); }); dispatcher.on('error', console.error);