fix(Event): this.message is undefined

Fixed #199
This commit is contained in:
March 7th 2022-07-12 21:29:59 +07:00
parent 1a6b3addfe
commit 02348ef5ad
4 changed files with 15 additions and 15 deletions

4
package-lock.json generated
View File

@ -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",

View File

@ -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",

View File

@ -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);
});
}
}

View File

@ -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);
});
}
}