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) {
const referenced = await channel.messages.fetch(reference.messageId).catch(() => null);
if(referenced) embed.fields.push({
name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }),
value: wrapper.format('MSGLOG_REPLY_VALUE', {
content: referenced.content.length > 900 ? referenced.content.substring(0, 900) + '...' : referenced.content,
link: referenced.url
})
});
if (referenced) {
// 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({
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) {
@ -586,21 +595,24 @@ class GuildLogger extends Observer {
});
if (reference && reference.channelId === channel.id) {
const referenced = await channel.messages.fetch(reference.messageId);
// 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');
const referenced = await channel.messages.fetch(reference.messageId).catch(() => null);
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 (referenced) {
// 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({
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');