aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorHellyson Rodrigo Parteka <[email protected]>2022-03-09 23:47:52 -0300
committerGitHub <[email protected]>2022-03-09 20:47:52 -0600
commit3dd1f219457c56a3b182fa1919cf182ab780426c (patch)
tree7ab8bfdf96e94e66d8c556b196346e19ae210f33 /src/utils
parentd438d46c09c236b34d5cecf75662ae94e7eca9cf (diff)
downloadmuse-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')
-rw-r--r--src/utils/build-embed.ts4
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) => {