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,14 +192,23 @@ 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) {
// 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 }), name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }),
value: wrapper.format('MSGLOG_REPLY_VALUE', { value: wrapper.format('MSGLOG_REPLY_VALUE', {
content: referenced.content.length > 900 ? referenced.content.substring(0, 900) + '...' : referenced.content, content,
link: referenced.url link: referenced.url
}) })
}); });
} }
}
if (message.filtered) { if (message.filtered) {
@ -586,7 +595,9 @@ 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);
if (referenced) {
// eslint-disable-next-line no-nested-ternary // eslint-disable-next-line no-nested-ternary
const content = referenced.content ? const content = referenced.content ?
referenced.content.length > 900 ? referenced.content.length > 900 ?
@ -602,6 +613,7 @@ class GuildLogger extends Observer {
}) })
}); });
} }
}
//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');
//if(newMessage.content.length > 1024) embed.description += '\n' + oldMessage.format('MSGLOG_EDIT_NEW_CUTOFF'); //if(newMessage.content.length > 1024) embed.description += '\n' + oldMessage.format('MSGLOG_EDIT_NEW_CUTOFF');