diff --git a/packages/discord.js/src/structures/InteractionCollector.js b/packages/discord.js/src/structures/InteractionCollector.js index cfbb9170d..36b0f6103 100644 --- a/packages/discord.js/src/structures/InteractionCollector.js +++ b/packages/discord.js/src/structures/InteractionCollector.js @@ -211,7 +211,7 @@ class InteractionCollector extends Collector { this.stop('messageDelete'); } - if (message.interaction.id === this.messageInteractionId) { + if (message.interaction?.id === this.messageInteractionId) { this.stop('messageDelete'); } } diff --git a/packages/discord.js/src/structures/interfaces/InteractionResponses.js b/packages/discord.js/src/structures/interfaces/InteractionResponses.js index 3a05b8811..91beea939 100644 --- a/packages/discord.js/src/structures/interfaces/InteractionResponses.js +++ b/packages/discord.js/src/structures/interfaces/InteractionResponses.js @@ -197,7 +197,7 @@ class InteractionResponses { }); this.deferred = true; - return options.fetchReply ? this.fetchReply() : new InteractionResponse(this, this.message.interaction.id); + return options.fetchReply ? this.fetchReply() : new InteractionResponse(this, this.message.interaction?.id); } /** @@ -232,7 +232,7 @@ class InteractionResponses { }); this.replied = true; - return options.fetchReply ? this.fetchReply() : new InteractionResponse(this, this.message.interaction.id); + return options.fetchReply ? this.fetchReply() : new InteractionResponse(this, this.message.interaction?.id); } /**