fedimbed: potentially better spacing between stats and timestamp
This commit is contained in:
		
							parent
							
								
									31d61af27e
								
							
						
					
					
						commit
						efcd4fbe7b
					
				
					 1 changed files with 11 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -443,7 +443,7 @@ async function blueskyQuoteEmbed(quote) {
 | 
			
		|||
    components: [
 | 
			
		||||
      {
 | 
			
		||||
        type: 10,
 | 
			
		||||
        content: `-# ${getStatsBluesky(quote)}\n${Icons.fedimbed.bluesky} Bluesky \u2022 <t:${Math.floor(
 | 
			
		||||
        content: `### -# ${getStatsBluesky(quote)}\n${Icons.fedimbed.bluesky} Bluesky \u2022 <t:${Math.floor(
 | 
			
		||||
          new Date(quote.value.createdAt).getTime() / 1000
 | 
			
		||||
        )}:F>`,
 | 
			
		||||
      },
 | 
			
		||||
| 
						 | 
				
			
			@ -682,7 +682,7 @@ async function bluesky(msg, url, spoiler = false) {
 | 
			
		|||
    components: [
 | 
			
		||||
      {
 | 
			
		||||
        type: 10,
 | 
			
		||||
        content: `-# ${getStatsBluesky(post)}\n${Icons.fedimbed.bluesky} Bluesky \u2022 <t:${Math.floor(
 | 
			
		||||
        content: `### -# ${getStatsBluesky(post)}\n${Icons.fedimbed.bluesky} Bluesky \u2022 <t:${Math.floor(
 | 
			
		||||
          new Date(post.record.createdAt).getTime() / 1000
 | 
			
		||||
        )}:F>`,
 | 
			
		||||
      },
 | 
			
		||||
| 
						 | 
				
			
			@ -1443,7 +1443,7 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
 | 
			
		|||
    components: [
 | 
			
		||||
      {
 | 
			
		||||
        type: 10,
 | 
			
		||||
        content: `${stats.length > 0 ? "-# " + stats + "\n" : ""}${
 | 
			
		||||
        content: `${stats.length > 0 ? "### -# " + stats + "\n" : ""}${
 | 
			
		||||
          footerIcon ? footerIcon + " " : ""
 | 
			
		||||
        }${platformName} \u2022 <t:${Math.floor(new Date(timestamp).getTime() / 1000)}:F>`,
 | 
			
		||||
      },
 | 
			
		||||
| 
						 | 
				
			
			@ -1502,6 +1502,8 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
 | 
			
		|||
 | 
			
		||||
  container.components.push(footer);
 | 
			
		||||
 | 
			
		||||
  const components = [cw.length > 0 && warningText, container];
 | 
			
		||||
 | 
			
		||||
  if (quoteRes) {
 | 
			
		||||
    const quoteComponents = quoteRes.response.components[0].components;
 | 
			
		||||
    const quoteContext = `-# ${Icons.fedimbed.quote} Quoted Post`;
 | 
			
		||||
| 
						 | 
				
			
			@ -1510,13 +1512,17 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
 | 
			
		|||
    } else {
 | 
			
		||||
      quoteComponents.splice(0, 0, {type: 10, content: quoteContext});
 | 
			
		||||
    }
 | 
			
		||||
    container.components.push({type: 14}, ...quoteComponents);
 | 
			
		||||
    if (container.components.length + quoteComponents.length + 1 > 10) {
 | 
			
		||||
      components.push(quoteComponents);
 | 
			
		||||
    } else {
 | 
			
		||||
      container.components.push({type: 14}, ...quoteComponents);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return {
 | 
			
		||||
    response: {
 | 
			
		||||
      flags: 1 << 15,
 | 
			
		||||
      components: [cw.length > 0 && warningText, container].filter((x) => !!x),
 | 
			
		||||
      components: components.filter((x) => !!x),
 | 
			
		||||
      allowedMentions: {
 | 
			
		||||
        repliedUser: false,
 | 
			
		||||
      },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue