From 02348ef5addce63713c2acbab555f850a0e4bdb3 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Tue, 12 Jul 2022 21:29:59 +0700 Subject: [PATCH] fix(Event): this.message is undefined Fixed #199 --- package-lock.json | 4 ++-- package.json | 2 +- src/structures/MessageButton.js | 12 ++++++------ src/structures/MessageSelectMenu.js | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 77f7adc..c6ad7a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "discord.js-selfbot-v13", - "version": "2.3.72", + "version": "2.3.73", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "discord.js-selfbot-v13", - "version": "2.3.72", + "version": "2.3.73", "license": "GNU General Public License v3.0", "dependencies": { "@aikochan2k6/qrcode-terminal": "^0.12.0", diff --git a/package.json b/package.json index 621cba2..b232f74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord.js-selfbot-v13", - "version": "2.3.72", + "version": "2.3.73", "description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]", "main": "./src/index.js", "types": "./typings/index.d.ts", diff --git a/src/structures/MessageButton.js b/src/structures/MessageButton.js index 3dd75ef..5f56ed6 100644 --- a/src/structures/MessageButton.js +++ b/src/structures/MessageButton.js @@ -194,18 +194,18 @@ class MessageButton extends BaseMessageComponent { timeout.refresh(); if (data.metadata.nonce !== nonce) return; clearTimeout(timeout); - this.message.client.removeListener('interactionResponse', handler); - this.message.client.decrementMaxListeners(); + message.client.removeListener('interactionResponse', handler); + message.client.decrementMaxListeners(); if (data.status) resolve(data.metadata); else reject(data.metadata); }; const timeout = setTimeout(() => { - this.message.client.removeListener('interactionResponse', handler); - this.message.client.decrementMaxListeners(); + message.client.removeListener('interactionResponse', handler); + message.client.decrementMaxListeners(); reject(new Error('INTERACTION_TIMEOUT')); }, 15_000).unref(); - this.message.client.incrementMaxListeners(); - this.message.client.on('interactionResponse', handler); + message.client.incrementMaxListeners(); + message.client.on('interactionResponse', handler); }); } } diff --git a/src/structures/MessageSelectMenu.js b/src/structures/MessageSelectMenu.js index d1f250f..3e329b9 100644 --- a/src/structures/MessageSelectMenu.js +++ b/src/structures/MessageSelectMenu.js @@ -265,18 +265,18 @@ class MessageSelectMenu extends BaseMessageComponent { timeout.refresh(); if (data.metadata.nonce !== nonce) return; clearTimeout(timeout); - this.message.client.removeListener('interactionResponse', handler); - this.message.client.decrementMaxListeners(); + message.client.removeListener('interactionResponse', handler); + message.client.decrementMaxListeners(); if (data.status) resolve(data.metadata); else reject(data.metadata); }; const timeout = setTimeout(() => { - this.message.client.removeListener('interactionResponse', handler); - this.message.client.decrementMaxListeners(); + message.client.removeListener('interactionResponse', handler); + message.client.decrementMaxListeners(); reject(new Error('INTERACTION_TIMEOUT')); }, 15_000).unref(); - this.message.client.incrementMaxListeners(); - this.message.client.on('interactionResponse', handler); + message.client.incrementMaxListeners(); + message.client.on('interactionResponse', handler); }); } }