mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
refactor(MessageOptions): move replyTo to reply#messageReference and add failIfNotExists (#5298)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com> Co-authored-by: Shubham Parihar <shubhamparihar391@gmail.com>
This commit is contained in:
@@ -175,12 +175,15 @@ class APIMessage {
|
||||
}
|
||||
|
||||
let message_reference;
|
||||
if (typeof this.options.replyTo !== 'undefined') {
|
||||
if (typeof this.options.reply === 'object') {
|
||||
const message_id = this.isMessage
|
||||
? this.target.channel.messages.resolveID(this.options.replyTo)
|
||||
: this.target.messages.resolveID(this.options.replyTo);
|
||||
? this.target.channel.messages.resolveID(this.options.reply.messageReference)
|
||||
: this.target.messages.resolveID(this.options.reply.messageReference);
|
||||
if (message_id) {
|
||||
message_reference = { message_id };
|
||||
message_reference = {
|
||||
message_id,
|
||||
fail_if_not_exists: this.options.reply.failIfNotExists ?? true,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user