Skip to content

Commit

Permalink
Message FIx: message not sending if user input is the same as auto reply
Browse files Browse the repository at this point in the history
  • Loading branch information
pakkographic committed Aug 13, 2024
1 parent 0296c08 commit bcb3c6e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/structures/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,11 @@ export class Message<T extends AnyTextableChannel> extends Base<string> {
"please acknowledge the message using the createMessage method."
);

if (options.replyMessageIDs)
options.replyMessageIDs.push(this.id);
else
if (!options.replyMessageIDs) {
options.replyMessageIDs = [this.id];
} else if (!options.replyMessageIDs.includes(this.id)) {
options.replyMessageIDs.push(this.id);
}

if (options.replyMessageIDs?.includes(this.originals.triggerID ?? " ")) {
options.replyMessageIDs[options.replyMessageIDs.length - 1] = this.originals.responseID;
Expand Down Expand Up @@ -330,11 +331,13 @@ export class Message<T extends AnyTextableChannel> extends Base<string> {
);
if (!this.isOriginal && !(this.originals.triggerID)) this.originals.triggerID = this.id;

if (!(this.client.params.deprecations?.independentMessageBehavior)) {
if (options.replyMessageIDs)
options.replyMessageIDs.push(this.originals.triggerID ?? this.id);
else
options.replyMessageIDs = [this.originals.triggerID ?? this.id];
if (!this.client.params.deprecations?.independentMessageBehavior) {
const idToUse = this.originals.triggerID ?? this.id;
if (!options.replyMessageIDs) {
options.replyMessageIDs = [idToUse];
} else if (!options.replyMessageIDs.includes(idToUse)) {
options.replyMessageIDs.push(idToUse);
}
}

const response =
Expand Down

0 comments on commit bcb3c6e

Please sign in to comment.