diff --git a/packages/core/src/structures/message.ts b/packages/core/src/structures/message.ts index dd8b00a..f26073f 100644 --- a/packages/core/src/structures/message.ts +++ b/packages/core/src/structures/message.ts @@ -95,6 +95,7 @@ export interface CreateMessage { */ export interface EditMessage extends Partial { flags?: MessageFlags; + attachments?: Attachment[]; } /** @@ -413,7 +414,7 @@ export class Message implements Model { /** Edits the current message */ async edit(options: EditMessage): Promise { - const message = await this.session.rest.post( + const message = await this.session.rest.patch( CHANNEL_MESSAGE(this.id, this.channelId), { content: options.content, @@ -425,6 +426,9 @@ export class Message implements Model { }, flags: options.flags, embeds: options.embeds, + components: options.components, + files: options.files, + attachments: options.attachments } ); @@ -446,9 +450,9 @@ export class Message implements Model { /** deletes this message */ async delete(reason?: string): Promise { - await this.session.rest.delete( + await this.session.rest.delete( CHANNEL_MESSAGE(this.channelId, this.id), - { reason } + { headers: { 'X-Audit-Log-Reason': reason } } ); return this;