mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
fix(TextBasedChannel): Fix MessageCreate handling (#6217)
This commit is contained in:
@@ -167,9 +167,15 @@ class TextBasedChannel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { data, files } = await messagePayload.resolveFiles();
|
const { data, files } = await messagePayload.resolveFiles();
|
||||||
return this.client.api.channels[this.id].messages
|
const d = await this.client.api.channels[this.id].messages.post({ data, files });
|
||||||
.post({ data, files })
|
|
||||||
.then(d => this.client.actions.MessageCreate.handle(d).message);
|
const existing = this.messages.cache.get(d.id);
|
||||||
|
if (existing) {
|
||||||
|
const clone = existing._clone();
|
||||||
|
clone._patch(d);
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
|
return this.messages._add(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user