bugfixes
This commit is contained in:
parent
a38705f39e
commit
610046700b
@ -192,14 +192,23 @@ 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({
|
||||
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: referenced.content.length > 900 ? referenced.content.substring(0, 900) + '...' : referenced.content,
|
||||
content,
|
||||
link: referenced.url
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (message.filtered) {
|
||||
|
||||
@ -586,7 +595,9 @@ class GuildLogger extends Observer {
|
||||
});
|
||||
|
||||
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
|
||||
const content = referenced.content ?
|
||||
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(newMessage.content.length > 1024) embed.description += '\n' + oldMessage.format('MSGLOG_EDIT_NEW_CUTOFF');
|
||||
|
Loading…
Reference in New Issue
Block a user