bugfix to message 404

This commit is contained in:
Erik 2022-05-06 21:31:09 +03:00
parent a7261c94fe
commit 09043d7e8d
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -191,8 +191,8 @@ class GuildLogger extends Observer {
};
if (reference && reference.channelId === channel.id) {
const referenced = await channel.messages.fetch(reference.messageId);
embed.fields.push({
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,