From 29f767ce1172a72008c67080923fd76f8735f50a Mon Sep 17 00:00:00 2001 From: Monbrey Date: Mon, 14 Jun 2021 21:56:57 +1000 Subject: [PATCH] refactor: construct a MessageFlags instance --- src/structures/interfaces/InteractionResponses.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/interfaces/InteractionResponses.js b/src/structures/interfaces/InteractionResponses.js index 15548c22122e..31a6c96fc680 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -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({ @@ -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'); }