fedimbed: add timestamps

This commit is contained in:
Cynthia Foxwell 2022-12-05 20:39:20 -07:00
parent 13b6357640
commit 04283d72a6

View file

@ -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,