mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-19 04:38:17 +00:00
rework message sending getters
This commit is contained in:
@@ -78,7 +78,7 @@ const baseMessage: Partial<Message> = {
|
|||||||
addReactions(reactions, ordered) {
|
addReactions(reactions, ordered) {
|
||||||
return addReactions(this.channelID!, this.id!, reactions, ordered);
|
return addReactions(this.channelID!, this.id!, reactions, ordered);
|
||||||
},
|
},
|
||||||
sendResponse(content) {
|
reply(content) {
|
||||||
const contentWithMention = typeof content === "string"
|
const contentWithMention = typeof content === "string"
|
||||||
? { content, mentions: { repliedUser: true }, replyMessageID: this.id }
|
? { content, mentions: { repliedUser: true }, replyMessageID: this.id }
|
||||||
: {
|
: {
|
||||||
@@ -89,7 +89,7 @@ const baseMessage: Partial<Message> = {
|
|||||||
|
|
||||||
return sendMessage(this.channelID!, contentWithMention);
|
return sendMessage(this.channelID!, contentWithMention);
|
||||||
},
|
},
|
||||||
reply(content) {
|
send(content) {
|
||||||
return sendMessage(this.channelID!, content);
|
return sendMessage(this.channelID!, content);
|
||||||
},
|
},
|
||||||
alert(content, timeout = 10, reason = "") {
|
alert(content, timeout = 10, reason = "") {
|
||||||
@@ -97,8 +97,8 @@ const baseMessage: Partial<Message> = {
|
|||||||
response.delete(reason, timeout * 1000).catch(console.error);
|
response.delete(reason, timeout * 1000).catch(console.error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
alertResponse(content, timeout = 10, reason = "") {
|
alertReply(content, timeout = 10, reason = "") {
|
||||||
return this.sendResponse!(content).then((response) =>
|
return this.reply!(content).then((response) =>
|
||||||
response.delete(reason, timeout * 1000).catch(console.error)
|
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. */
|
/** Add multiple reactions to the message without or without order. */
|
||||||
addReactions(reactions: string[], ordered?: boolean): Promise<void>;
|
addReactions(reactions: string[], ordered?: boolean): Promise<void>;
|
||||||
/** Send a inline reply to this message */
|
/** Send a inline reply to this message */
|
||||||
sendResponse(content: string | MessageContent): Promise<Message>;
|
|
||||||
/** Send a message to this channel where this message is */
|
|
||||||
reply(content: string | MessageContent): Promise<Message>;
|
reply(content: string | MessageContent): Promise<Message>;
|
||||||
|
/** Send a message to this channel where this message is */
|
||||||
|
send(content: string | MessageContent): Promise<Message>;
|
||||||
/** 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. */
|
/** 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(
|
alert(
|
||||||
content: string | MessageContent,
|
content: string | MessageContent,
|
||||||
@@ -245,7 +245,7 @@ export interface Message {
|
|||||||
reason?: string,
|
reason?: string,
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
/** 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. */
|
/** 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,
|
content: string | MessageContent,
|
||||||
timeout?: number,
|
timeout?: number,
|
||||||
reason?: string,
|
reason?: string,
|
||||||
|
|||||||
Reference in New Issue
Block a user