diff --git a/src/client/actions/MessageCreate.js b/src/client/actions/MessageCreate.js index 7f4df687a..e1f2c6ad4 100644 --- a/src/client/actions/MessageCreate.js +++ b/src/client/actions/MessageCreate.js @@ -5,12 +5,12 @@ class MessageCreateAction extends Action { handle(data) { const client = this.client; const channel = client.channels.get(data.channel_id); - const user = client.users.get(data.author.id); if (channel) { const existing = channel.messages.get(data.id); if (existing) return { message: existing }; - const member = channel.guild ? channel.guild.member(user) : null; const message = channel.messages.create(data); + const user = message.author; + const member = channel.guild ? channel.guild.member(user) : null; channel.lastMessageID = data.id; channel.lastMessage = message; if (user) { diff --git a/src/structures/Message.js b/src/structures/Message.js index 58fc9d26f..6daf1bd51 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -52,7 +52,7 @@ class Message extends Base { * The author of the message * @type {User} */ - this.author = this.client.users.create(data.author); + this.author = this.client.users.create(data.author, !data.webhook_id); /** * Represents the author of the message as a guild member