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: [
|
components: [
|
||||||
{
|
{
|
||||||
type: 10,
|
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
|
new Date(quote.value.createdAt).getTime() / 1000
|
||||||
)}:F>`,
|
)}:F>`,
|
||||||
},
|
},
|
||||||
|
@ -682,7 +682,7 @@ async function bluesky(msg, url, spoiler = false) {
|
||||||
components: [
|
components: [
|
||||||
{
|
{
|
||||||
type: 10,
|
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
|
new Date(post.record.createdAt).getTime() / 1000
|
||||||
)}:F>`,
|
)}:F>`,
|
||||||
},
|
},
|
||||||
|
@ -1443,7 +1443,7 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
|
||||||
components: [
|
components: [
|
||||||
{
|
{
|
||||||
type: 10,
|
type: 10,
|
||||||
content: `${stats.length > 0 ? "-# " + stats + "\n" : ""}${
|
content: `${stats.length > 0 ? "### -# " + stats + "\n" : ""}${
|
||||||
footerIcon ? footerIcon + " " : ""
|
footerIcon ? footerIcon + " " : ""
|
||||||
}${platformName} \u2022 <t:${Math.floor(new Date(timestamp).getTime() / 1000)}:F>`,
|
}${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);
|
container.components.push(footer);
|
||||||
|
|
||||||
|
const components = [cw.length > 0 && warningText, container];
|
||||||
|
|
||||||
if (quoteRes) {
|
if (quoteRes) {
|
||||||
const quoteComponents = quoteRes.response.components[0].components;
|
const quoteComponents = quoteRes.response.components[0].components;
|
||||||
const quoteContext = `-# ${Icons.fedimbed.quote} Quoted Post`;
|
const quoteContext = `-# ${Icons.fedimbed.quote} Quoted Post`;
|
||||||
|
@ -1510,13 +1512,17 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
|
||||||
} else {
|
} else {
|
||||||
quoteComponents.splice(0, 0, {type: 10, content: quoteContext});
|
quoteComponents.splice(0, 0, {type: 10, content: quoteContext});
|
||||||
}
|
}
|
||||||
|
if (container.components.length + quoteComponents.length + 1 > 10) {
|
||||||
|
components.push(quoteComponents);
|
||||||
|
} else {
|
||||||
container.components.push({type: 14}, ...quoteComponents);
|
container.components.push({type: 14}, ...quoteComponents);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
response: {
|
response: {
|
||||||
flags: 1 << 15,
|
flags: 1 << 15,
|
||||||
components: [cw.length > 0 && warningText, container].filter((x) => !!x),
|
components: components.filter((x) => !!x),
|
||||||
allowedMentions: {
|
allowedMentions: {
|
||||||
repliedUser: false,
|
repliedUser: false,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue