diff options
Diffstat (limited to 'src/utils/build-embed.ts')
| -rw-r--r-- | src/utils/build-embed.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/build-embed.ts b/src/utils/build-embed.ts index 5a2f758..cb9e634 100644 --- a/src/utils/build-embed.ts +++ b/src/utils/build-embed.ts @@ -13,13 +13,13 @@ const getMaxSongTitleLength = (title: string) => { return nonASCII.test(title) ? 28 : 48; }; -const getSongTitle = ({title, url}: QueuedSong, shouldTruncate = false) => { +const getSongTitle = ({title, url, offset}: QueuedSong, shouldTruncate = false) => { const cleanSongTitle = title.replace(/\[.*\]/, '').trim(); const songTitle = shouldTruncate ? truncate(cleanSongTitle, getMaxSongTitleLength(cleanSongTitle)) : cleanSongTitle; const youtubeId = url.length === 11 ? url : getYouTubeID(url) ?? ''; - return `[${songTitle}](https://www.youtube.com/watch?v=${youtubeId})`; + return `[${songTitle}](https://www.youtube.com/watch?v=${youtubeId}${offset === 0 ? '' : '&t=' + String(offset)})`; }; const getQueueInfo = (player: Player) => { |
