feat: reject full log (InteractionTimeout)

This commit is contained in:
March 7th
2022-12-12 18:40:55 +07:00
parent dea8324c00
commit be786d3876
4 changed files with 24 additions and 8 deletions
+10 -2
View File
@@ -907,7 +907,11 @@ class ApplicationCommand extends Base {
const timeout = setTimeout(() => {
this.client.removeListener('interactionResponse', handler);
this.client.decrementMaxListeners();
reject(new Error('INTERACTION_TIMEOUT'));
reject(
new Error('INTERACTION_TIMEOUT', {
cause: data,
}),
);
}, this.client.options.interactionTimeout).unref();
this.client.incrementMaxListeners();
this.client.on('interactionResponse', handler);
@@ -998,7 +1002,11 @@ class ApplicationCommand extends Base {
const timeout = setTimeout(() => {
this.client.removeListener('interactionResponse', handler);
this.client.decrementMaxListeners();
reject(new Error('INTERACTION_TIMEOUT'));
reject(
new Error('INTERACTION_TIMEOUT', {
cause: data,
}),
);
}, this.client.options.interactionTimeout).unref();
this.client.incrementMaxListeners();
this.client.on('interactionResponse', handler);