mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
update webhook cache and message cache stuff (#1910)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user