mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 04:52:22 +00:00
update webhook cache and message cache stuff (#1910)
This commit is contained in:
parent
dd085ceaee
commit
67c239b33f
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue