ChannelArchiver: include message reactions in archive
This commit is contained in:
parent
cd07a3e32e
commit
afd677b270
1 changed files with 9 additions and 0 deletions
|
@ -106,6 +106,7 @@ export class ChannelArchiverPlugin extends ZeppelinPlugin {
|
||||||
let content = `[${ts}] [${message.author.id}] [${message.author.username}#${
|
let content = `[${ts}] [${message.author.id}] [${message.author.username}#${
|
||||||
message.author.discriminator
|
message.author.discriminator
|
||||||
}]: ${message.content || "<no text content>"}`;
|
}]: ${message.content || "<no text content>"}`;
|
||||||
|
|
||||||
if (message.attachments.length) {
|
if (message.attachments.length) {
|
||||||
if (args["attachment-channel"]) {
|
if (args["attachment-channel"]) {
|
||||||
const rehostedAttachmentUrl = await this.rehostAttachment(
|
const rehostedAttachmentUrl = await this.rehostAttachment(
|
||||||
|
@ -118,6 +119,14 @@ export class ChannelArchiverPlugin extends ZeppelinPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message.reactions && Object.keys(message.reactions).length > 0) {
|
||||||
|
const reactionCounts = [];
|
||||||
|
for (const [emoji, info] of Object.entries(message.reactions)) {
|
||||||
|
reactionCounts.push(`${info.count}x ${emoji}`);
|
||||||
|
}
|
||||||
|
content += `\n-- Reactions: ${reactionCounts.join(", ")}`;
|
||||||
|
}
|
||||||
|
|
||||||
archiveLines.push(content);
|
archiveLines.push(content);
|
||||||
previousId = message.id;
|
previousId = message.id;
|
||||||
archivedMessages++;
|
archivedMessages++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue