Skip to content

Commit 4176c5e

Browse files
committed
messageUpdate handling error fix
Fixed a problem that occurred when the author field is not present in the new message after editing.
1 parent f394ab8 commit 4176c5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

handlers/events/messageUpdate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default async (oldMessage, newMessage, locale) => {
88
if (newMessage.guild && newMessage.guild.id !== client.baseGuild.id) return;
99

1010
// Prevents execution if the message was sent by a bot or the system
11-
if (newMessage.author.bot || newMessage.type !== discord.MessageType.Default) return;
11+
if (!newMessage.author || newMessage.author.bot || newMessage.type !== discord.MessageType.Default) return;
1212

1313
// Aborts if the content of the message was not modified
1414
if(oldMessage.content === newMessage.content) return;

0 commit comments

Comments
 (0)