music.queue: timestamps try 3
This commit is contained in:
		
							parent
							
								
									b20344e2a3
								
							
						
					
					
						commit
						a3f32a8954
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		| 
						 | 
					@ -607,8 +607,7 @@ command.callback = async function (msg, line) {
 | 
				
			||||||
      const nowPlaying = connection._music_nowplaying;
 | 
					      const nowPlaying = connection._music_nowplaying;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const now = Date.now();
 | 
					      const now = Date.now();
 | 
				
			||||||
      let nextTrack =
 | 
					      let nextTrack = now + (nowPlaying.length - (now - nowPlaying.start));
 | 
				
			||||||
        now + (Math.floor(nowPlaying.length / 1000) - (now - nowPlaying.start));
 | 
					 | 
				
			||||||
      const fields = [];
 | 
					      const fields = [];
 | 
				
			||||||
      for (const index in queue.slice(0, 8)) {
 | 
					      for (const index in queue.slice(0, 8)) {
 | 
				
			||||||
        const item = queue[index];
 | 
					        const item = queue[index];
 | 
				
			||||||
| 
						 | 
					@ -616,10 +615,12 @@ command.callback = async function (msg, line) {
 | 
				
			||||||
          name: item.title ?? item.url,
 | 
					          name: item.title ?? item.url,
 | 
				
			||||||
          value: `${item.title ? `[Link](${item.url}) - ` : ""}${formatTime(
 | 
					          value: `${item.title ? `[Link](${item.url}) - ` : ""}${formatTime(
 | 
				
			||||||
            item.length
 | 
					            item.length
 | 
				
			||||||
          )}\nAdded by: <@${item.addedBy}>\n<t:${nextTrack}:R>`,
 | 
					          )}\nAdded by: <@${item.addedBy}>\n<t:${Math.floor(
 | 
				
			||||||
 | 
					            nextTrack / 1000
 | 
				
			||||||
 | 
					          )}:R>`,
 | 
				
			||||||
          inline: true,
 | 
					          inline: true,
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        nextTrack += Math.floor(item.length / 1000);
 | 
					        nextTrack += item.length;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      return {
 | 
					      return {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue