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 e8a4e6c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { InteractionResponseType, MessageFlags, Routes, InteractionType } = requi
const { DiscordjsError, ErrorCodes } = require('../../errors');
const InteractionCollector = require('../InteractionCollector');
const InteractionResponse = require('../InteractionResponse');
const MessageFlagsBitField = require('../../util/MessageFlagsBitField');

Check failure on line 8 in packages/discord.js/src/structures/interfaces/InteractionResponses.js

View workflow job for this annotation

GitHub Actions / Tests

`../../util/MessageFlagsBitField` import should occur before import of `../InteractionCollector`
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 e8a4e6c

Please sign in to comment.