presence: escape colons, add more verbose time stuff
This commit is contained in:
		
							parent
							
								
									105805fb69
								
							
						
					
					
						commit
						37f550ac1e
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -172,9 +172,13 @@ presence.callback = async function (msg, line) {
 | 
			
		|||
 | 
			
		||||
        if (activity.timestamps) {
 | 
			
		||||
          if (activity.timestamps.start && !activity.timestamps.end) {
 | 
			
		||||
            descLines.push(formatTime(Date.now() - activity.timestamps.start) + " elapsed");
 | 
			
		||||
            descLines.push(formatTime(Date.now() - activity.timestamps.start).replaceAll(":", "\\:") + " elapsed");
 | 
			
		||||
            descLines.push(
 | 
			
		||||
              `-# <t:${Math.floor(activity.timestamps.start / 1000)}:R> \u2022 ${activity.timestamps.start}`
 | 
			
		||||
            );
 | 
			
		||||
          } else if (!activity.timestamps.start && activity.timestamps.end) {
 | 
			
		||||
            descLines.push(formatTime(activity.timestamps.end - Date.now()) + " remaining");
 | 
			
		||||
            descLines.push(formatTime(activity.timestamps.end - Date.now()).replaceAll(":", "\\:") + " remaining");
 | 
			
		||||
            descLines.push(`-# <t:${Math.floor(activity.timestamps.end / 1000)}:R> \u2022 ${activity.timestamps.end}`);
 | 
			
		||||
          } else if (activity.timestamps.start != null && activity.timestamps.end != null) {
 | 
			
		||||
            const position = Date.now() - activity.timestamps.start;
 | 
			
		||||
            const length = activity.timestamps.end - activity.timestamps.start;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue