3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix missing content in message archives

This commit is contained in:
Dragory 2021-08-18 20:09:25 +03:00
parent 59e75e0584
commit e6286c3eaa
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -82,20 +82,23 @@ export class GuildArchives extends BaseGuildRepository {
const channel = guild.channels.cache.get(msg.channel_id as Snowflake);
const partialUser = new TemplateSafeValueContainer({ ...msg.data.author, id: msg.user_id });
const values = new TemplateSafeValueContainer({
id: msg.id,
timestamp: moment.utc(msg.posted_at).format("YYYY-MM-DD HH:mm:ss"),
content: msg.data.content,
attachments: msg.data.attachments?.map(att => {
return JSON.stringify({ name: att.name, url: att.url, type: att.contentType });
const line = await renderTemplate(
MESSAGE_ARCHIVE_MESSAGE_FORMAT,
new TemplateSafeValueContainer({
id: msg.id,
timestamp: moment.utc(msg.posted_at).format("YYYY-MM-DD HH:mm:ss"),
content: msg.data.content,
attachments: msg.data.attachments?.map(att => {
return JSON.stringify({ name: att.name, url: att.url, type: att.contentType });
}),
stickers: msg.data.stickers?.map(sti => {
return JSON.stringify({ name: sti.name, id: sti.id, isDefault: isDefaultSticker(sti.id) });
}),
user: partialUser,
channel: channel ? channelToTemplateSafeChannel(channel) : null,
}),
stickers: msg.data.stickers?.map(sti => {
return JSON.stringify({ name: sti.name, id: sti.id, isDefault: isDefaultSticker(sti.id) });
}),
user: partialUser,
channel: channel ? channelToTemplateSafeChannel(channel) : null,
});
const line = await renderTemplate(MESSAGE_ARCHIVE_MESSAGE_FORMAT, {});
);
msgLines.push(line);
}
return msgLines;