fedimbed: add timestamps
This commit is contained in:
parent
13b6357640
commit
04283d72a6
1 changed files with 5 additions and 2 deletions
|
@ -143,6 +143,7 @@ async function processUrl(msg, url) {
|
||||||
url: postData2.account.url,
|
url: postData2.account.url,
|
||||||
avatar: postData2.account.avatar,
|
avatar: postData2.account.avatar,
|
||||||
};
|
};
|
||||||
|
timestamp = postData2.created_at;
|
||||||
for (const attachment of postData2.media_attachments) {
|
for (const attachment of postData2.media_attachments) {
|
||||||
attachments.push({
|
attachments.push({
|
||||||
url: attachment.url,
|
url: attachment.url,
|
||||||
|
@ -159,6 +160,7 @@ async function processUrl(msg, url) {
|
||||||
} else {
|
} else {
|
||||||
content = postData.content;
|
content = postData.content;
|
||||||
cw = postData.summary;
|
cw = postData.summary;
|
||||||
|
timestamp = postData.published;
|
||||||
for (const attachment of postData.attachment) {
|
for (const attachment of postData.attachment) {
|
||||||
attachments.push({
|
attachments.push({
|
||||||
url: attachment.url,
|
url: attachment.url,
|
||||||
|
@ -229,10 +231,11 @@ async function processUrl(msg, url) {
|
||||||
const baseEmbed = {
|
const baseEmbed = {
|
||||||
color,
|
color,
|
||||||
url,
|
url,
|
||||||
|
timestamp,
|
||||||
description: desc,
|
description: desc,
|
||||||
title: `${author.name} (${author.handle})`,
|
title: `${author.name} (${author.handle})`,
|
||||||
author: {
|
footer: {
|
||||||
name: platformName,
|
text: platformName,
|
||||||
},
|
},
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: author.avatar,
|
url: author.avatar,
|
||||||
|
|
Loading…
Reference in a new issue