3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-18 15:00:00 +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,7 +82,9 @@ export class GuildArchives extends BaseGuildRepository {
const channel = guild.channels.cache.get(msg.channel_id as Snowflake); const channel = guild.channels.cache.get(msg.channel_id as Snowflake);
const partialUser = new TemplateSafeValueContainer({ ...msg.data.author, id: msg.user_id }); const partialUser = new TemplateSafeValueContainer({ ...msg.data.author, id: msg.user_id });
const values = new TemplateSafeValueContainer({ const line = await renderTemplate(
MESSAGE_ARCHIVE_MESSAGE_FORMAT,
new TemplateSafeValueContainer({
id: msg.id, id: msg.id,
timestamp: moment.utc(msg.posted_at).format("YYYY-MM-DD HH:mm:ss"), timestamp: moment.utc(msg.posted_at).format("YYYY-MM-DD HH:mm:ss"),
content: msg.data.content, content: msg.data.content,
@ -94,8 +96,9 @@ export class GuildArchives extends BaseGuildRepository {
}), }),
user: partialUser, user: partialUser,
channel: channel ? channelToTemplateSafeChannel(channel) : null, channel: channel ? channelToTemplateSafeChannel(channel) : null,
}); }),
const line = await renderTemplate(MESSAGE_ARCHIVE_MESSAGE_FORMAT, {}); );
msgLines.push(line); msgLines.push(line);
} }
return msgLines; return msgLines;