Skip to content

Commit

Permalink
refactor: construct a MessageFlags instance
Browse files Browse the repository at this point in the history
  • Loading branch information
monbrey committed Jun 14, 2021
1 parent 912a36f commit 29f767c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/structures/interfaces/InteractionResponses.js
Expand Up @@ -156,7 +156,7 @@ class InteractionResponses {
*/
async deferUpdate(options = {}) {
if (this.deferred || this.replied) throw new Error('INTERACTION_ALREADY_REPLIED');
if (options.fetchReply && (this.message.flags & MessageFlags.FLAGS.EPHEMERAL) === MessageFlags.FLAGS.EPHEMERAL) {
if (options.fetchReply && new MessageFlags(this.message.flags).has(MessageFlags.FLAGS.EPHEMERAL)) {
throw new Error('INTERACTION_FETCH_EPHEMERAL');
}
await this.client.api.interactions(this.id, this.token).callback.post({
Expand Down Expand Up @@ -185,7 +185,7 @@ class InteractionResponses {
async update(options) {
if (this.deferred || this.replied) throw new Error('INTERACTION_ALREADY_REPLIED');

if (options.fetchReply && (this.message.flags & MessageFlags.FLAGS.EPHEMERAL) === MessageFlags.FLAGS.EPHEMERAL) {
if (options.fetchReply && new MessageFlags(this.message.flags).has(MessageFlags.FLAGS.EPHEMERAL)) {
throw new Error('INTERACTION_FETCH_EPHEMERAL');
}

Expand Down

0 comments on commit 29f767c

Please sign in to comment.