Skip to content

Commit

Permalink
fix(InteractionResponses): check if ephemeral message flag is used
Browse files Browse the repository at this point in the history
  • Loading branch information
sdanialraza committed Dec 3, 2023
1 parent 54453b0 commit 67360a9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const { isJSONEncodable } = require('@discordjs/util');
const { InteractionResponseType, MessageFlags, Routes, InteractionType } = require('discord-api-types/v10');
const { DiscordjsError, ErrorCodes } = require('../../errors');
const MessageFlagsBitField = require('../../util/MessageFlagsBitField');
const InteractionCollector = require('../InteractionCollector');
const InteractionResponse = require('../InteractionResponse');
const MessagePayload = require('../MessagePayload');
Expand Down Expand Up @@ -100,7 +101,7 @@ class InteractionResponses {
*/
async reply(options) {
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
this.ephemeral = options.ephemeral ?? false;
this.ephemeral = options.ephemeral ?? new MessageFlagsBitField(options.flags).has(MessageFlags.Ephemeral);

let messagePayload;
if (options instanceof MessagePayload) messagePayload = options;
Expand Down

0 comments on commit 67360a9

Please sign in to comment.