diff --git a/libs/message.mts b/libs/message.mts index b681f84..403359d 100644 --- a/libs/message.mts +++ b/libs/message.mts @@ -2,7 +2,7 @@ import { PrismaClient, Message, User } from "@prisma/client" import { access, readFile, constants, readdir } from "node:fs/promises" import { statSync } from "node:fs" import { join } from "node:path" -import { formatISO, fromUnixTime } from "date-fns" +import { format, formatISO, fromUnixTime } from "date-fns" import { WebClient as SlackClient } from "@slack/web-api" import { FileElement } from "@slack/web-api/dist/response/ChatPostMessageResponse" import { ChannelType, EmbedType } from "discord.js" @@ -226,7 +226,7 @@ export class MessageClient { maxFileSize: 8000000 | 50000000 | 100000000 ) { // Get post timestamp of message - const timestamp = formatISO(fromUnixTime(parseFloat(message.timestamp))) + const timestamp = fromUnixTime(parseFloat(message.timestamp)) let authorTypeIcon: "🟢" | "🔵" | "🤖" = "🟢" if (message.authorType === 2) authorTypeIcon = "🔵" @@ -248,11 +248,14 @@ export class MessageClient { type: EmbedType.Rich, color: message.authorColor, description: content, - timestamp: timestamp, + timestamp: formatISO(timestamp), author: { name: `${authorTypeIcon} ${message.authorName}`, icon_url: message.authorImageUrl, }, + footer: { + text: format(timestamp, "yyyy/MM/dd HH:mm"), + }, }, ]