diff options
| author | Hellyson Rodrigo Parteka <[email protected]> | 2022-03-09 23:47:52 -0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-03-09 20:47:52 -0600 |
| commit | 3dd1f219457c56a3b182fa1919cf182ab780426c (patch) | |
| tree | 7ab8bfdf96e94e66d8c556b196346e19ae210f33 /src/utils/build-embed.ts | |
| parent | d438d46c09c236b34d5cecf75662ae94e7eca9cf (diff) | |
| download | muse-3dd1f219457c56a3b182fa1919cf182ab780426c.tar.xz muse-3dd1f219457c56a3b182fa1919cf182ab780426c.zip | |
Add `split` command (#363)
Co-authored-by: Max Isom <[email protected]>
Co-authored-by: Max Isom <[email protected]>
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) => { |
