mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
fix: Message edit, delete
This commit is contained in:
parent
fd09fee3b6
commit
9bd75259a2
@ -95,6 +95,7 @@ export interface CreateMessage {
|
|||||||
*/
|
*/
|
||||||
export interface EditMessage extends Partial<CreateMessage> {
|
export interface EditMessage extends Partial<CreateMessage> {
|
||||||
flags?: MessageFlags;
|
flags?: MessageFlags;
|
||||||
|
attachments?: Attachment[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -413,7 +414,7 @@ export class Message implements Model {
|
|||||||
|
|
||||||
/** Edits the current message */
|
/** Edits the current message */
|
||||||
async edit(options: EditMessage): Promise<Message> {
|
async edit(options: EditMessage): Promise<Message> {
|
||||||
const message = await this.session.rest.post<DiscordMessage>(
|
const message = await this.session.rest.patch<DiscordMessage>(
|
||||||
CHANNEL_MESSAGE(this.id, this.channelId),
|
CHANNEL_MESSAGE(this.id, this.channelId),
|
||||||
{
|
{
|
||||||
content: options.content,
|
content: options.content,
|
||||||
@ -425,6 +426,9 @@ export class Message implements Model {
|
|||||||
},
|
},
|
||||||
flags: options.flags,
|
flags: options.flags,
|
||||||
embeds: options.embeds,
|
embeds: options.embeds,
|
||||||
|
components: options.components,
|
||||||
|
files: options.files,
|
||||||
|
attachments: options.attachments
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -446,9 +450,9 @@ export class Message implements Model {
|
|||||||
|
|
||||||
/** deletes this message */
|
/** deletes this message */
|
||||||
async delete(reason?: string): Promise<Message> {
|
async delete(reason?: string): Promise<Message> {
|
||||||
await this.session.rest.delete<undefined>(
|
await this.session.rest.delete<void>(
|
||||||
CHANNEL_MESSAGE(this.channelId, this.id),
|
CHANNEL_MESSAGE(this.channelId, this.id),
|
||||||
{ reason }
|
{ headers: { 'X-Audit-Log-Reason': reason } }
|
||||||
);
|
);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user