This commit is contained in:
Erik 2022-05-07 23:19:50 +03:00
parent a38705f39e
commit 610046700b
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -192,13 +192,22 @@ class GuildLogger extends Observer {
if (reference && reference.channelId === channel.id) { if (reference && reference.channelId === channel.id) {
const referenced = await channel.messages.fetch(reference.messageId).catch(() => null); const referenced = await channel.messages.fetch(reference.messageId).catch(() => null);
if(referenced) embed.fields.push({ if (referenced) {
name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }), // eslint-disable-next-line no-nested-ternary
value: wrapper.format('MSGLOG_REPLY_VALUE', { const content = referenced.content ?
content: referenced.content.length > 900 ? referenced.content.substring(0, 900) + '...' : referenced.content, referenced.content.length > 900 ?
link: referenced.url referenced.content.substring(0, 900) + '...' :
}) referenced.content :
}); wrapper.format('MSGLOG_REPLY_NOCONTENT');
embed.fields.push({
name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }),
value: wrapper.format('MSGLOG_REPLY_VALUE', {
content,
link: referenced.url
})
});
}
} }
if (message.filtered) { if (message.filtered) {
@ -586,21 +595,24 @@ class GuildLogger extends Observer {
}); });
if (reference && reference.channelId === channel.id) { if (reference && reference.channelId === channel.id) {
const referenced = await channel.messages.fetch(reference.messageId); const referenced = await channel.messages.fetch(reference.messageId).catch(() => null);
// eslint-disable-next-line no-nested-ternary
const content = referenced.content ?
referenced.content.length > 900 ?
referenced.content.substring(0, 900) + '...' :
referenced.content :
wrapper.format('MSGLOG_REPLY_NOCONTENT');
embed.fields.push({ if (referenced) {
name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }), // eslint-disable-next-line no-nested-ternary
value: wrapper.format('MSGLOG_REPLY_VALUE', { const content = referenced.content ?
content, referenced.content.length > 900 ?
link: referenced.url referenced.content.substring(0, 900) + '...' :
}) referenced.content :
}); wrapper.format('MSGLOG_REPLY_NOCONTENT');
embed.fields.push({
name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }),
value: wrapper.format('MSGLOG_REPLY_VALUE', {
content,
link: referenced.url
})
});
}
} }
//if(oldMessage.content.length > 1024) embed.description += '\n' + oldMessage.format('MSGLOG_EDIT_OLD_CUTOFF'); //if(oldMessage.content.length > 1024) embed.description += '\n' + oldMessage.format('MSGLOG_EDIT_OLD_CUTOFF');