fix(Message): editing with MessageEmbed or APIMessage (#5612)

This commit is contained in:
SpaceEEC
2021-05-11 22:22:48 +02:00
committed by GitHub
parent 2eac84296b
commit 74e97ef91b
3 changed files with 5 additions and 8 deletions

View File

@@ -494,11 +494,8 @@ class Message extends Base {
* .catch(console.error);
*/
edit(content, options) {
if (!options && typeof content === 'object' && !Array.isArray(content)) {
options = content;
content = undefined;
}
return this.channel.messages.edit(this.id, { content, ...options });
options = content instanceof APIMessage ? content : APIMessage.create(this.channel, content, options);
return this.channel.messages.edit(this.id, options);
}
/**