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:
parent
59e75e0584
commit
e6286c3eaa
1 changed files with 16 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue