diff --git a/src/structures/ApplicationCommand.js b/src/structures/ApplicationCommand.js index 15a6515..a891ebf 100644 --- a/src/structures/ApplicationCommand.js +++ b/src/structures/ApplicationCommand.js @@ -891,7 +891,7 @@ class ApplicationCommand extends Base { return new Promise((resolve, reject) => { const handler = data => { timeout.refresh(); - if (data.metadata.nonce !== nonce) return; + if (data.metadata?.nonce !== nonce) return; clearTimeout(timeout); this.client.removeListener('interactionResponse', handler); this.client.decrementMaxListeners(); @@ -987,7 +987,7 @@ class ApplicationCommand extends Base { return new Promise((resolve, reject) => { const handler = data => { timeout.refresh(); - if (data.metadata.nonce !== nonce) return; + if (data.metadata?.nonce !== nonce) return; clearTimeout(timeout); this.client.removeListener('interactionResponse', handler); this.client.decrementMaxListeners(); diff --git a/src/structures/MessageButton.js b/src/structures/MessageButton.js index 835d115..5b9455a 100644 --- a/src/structures/MessageButton.js +++ b/src/structures/MessageButton.js @@ -199,7 +199,7 @@ class MessageButton extends BaseMessageComponent { return new Promise((resolve, reject) => { const handler = data => { timeout.refresh(); - if (data.metadata.nonce !== nonce) return; + if (data.metadata?.nonce !== nonce) return; clearTimeout(timeout); message.client.removeListener('interactionResponse', handler); message.client.decrementMaxListeners(); diff --git a/src/structures/MessageSelectMenu.js b/src/structures/MessageSelectMenu.js index a017cc4..e597688 100644 --- a/src/structures/MessageSelectMenu.js +++ b/src/structures/MessageSelectMenu.js @@ -359,7 +359,7 @@ class MessageSelectMenu extends BaseMessageComponent { return new Promise((resolve, reject) => { const handler = data => { timeout.refresh(); - if (data.metadata.nonce !== nonce) return; + if (data.metadata?.nonce !== nonce) return; clearTimeout(timeout); message.client.removeListener('interactionResponse', handler); message.client.decrementMaxListeners(); diff --git a/src/structures/Modal.js b/src/structures/Modal.js index e929737..dd7812e 100644 --- a/src/structures/Modal.js +++ b/src/structures/Modal.js @@ -247,7 +247,7 @@ class Modal { return new Promise((resolve, reject) => { const handler = data => { timeout.refresh(); - if (data.metadata.nonce !== nonce) return; + if (data.metadata?.nonce !== nonce) return; clearTimeout(timeout); this.client.removeListener('interactionResponse', handler); this.client.decrementMaxListeners();