From 108142f025cbc1d630e497875175afcbb405e986 Mon Sep 17 00:00:00 2001 From: Skillz Date: Sun, 27 Dec 2020 11:27:30 -0500 Subject: [PATCH] rework message sending getters --- src/api/structures/message.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/api/structures/message.ts b/src/api/structures/message.ts index 658055dce..2ffa555ef 100644 --- a/src/api/structures/message.ts +++ b/src/api/structures/message.ts @@ -78,7 +78,7 @@ const baseMessage: Partial = { addReactions(reactions, ordered) { return addReactions(this.channelID!, this.id!, reactions, ordered); }, - sendResponse(content) { + reply(content) { const contentWithMention = typeof content === "string" ? { content, mentions: { repliedUser: true }, replyMessageID: this.id } : { @@ -89,7 +89,7 @@ const baseMessage: Partial = { return sendMessage(this.channelID!, contentWithMention); }, - reply(content) { + send(content) { return sendMessage(this.channelID!, content); }, alert(content, timeout = 10, reason = "") { @@ -97,8 +97,8 @@ const baseMessage: Partial = { response.delete(reason, timeout * 1000).catch(console.error); }); }, - alertResponse(content, timeout = 10, reason = "") { - return this.sendResponse!(content).then((response) => + alertReply(content, timeout = 10, reason = "") { + return this.reply!(content).then((response) => response.delete(reason, timeout * 1000).catch(console.error) ); }, @@ -235,9 +235,9 @@ export interface Message { /** Add multiple reactions to the message without or without order. */ addReactions(reactions: string[], ordered?: boolean): Promise; /** Send a inline reply to this message */ - sendResponse(content: string | MessageContent): Promise; - /** Send a message to this channel where this message is */ reply(content: string | MessageContent): Promise; + /** Send a message to this channel where this message is */ + send(content: string | MessageContent): Promise; /** Send a message to this channel and then delete it after a bit. By default it will delete after 10 seconds with no reason provided. */ alert( content: string | MessageContent, @@ -245,7 +245,7 @@ export interface Message { reason?: string, ): Promise; /** Send a inline reply to this message but then delete it after a bit. By default it will delete after 10 seconds with no reason provided. */ - alertResponse( + alertReply( content: string | MessageContent, timeout?: number, reason?: string,