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

View File

@@ -396,7 +396,11 @@ class MessageSelectMenu extends BaseMessageComponent {
const timeout = setTimeout(() => {
message.client.removeListener('interactionResponse', handler);
message.client.decrementMaxListeners();
reject(new Error('INTERACTION_TIMEOUT'));
reject(
new Error('INTERACTION_TIMEOUT', {
cause: data,
}),
);
}, message.client.options.interactionTimeout).unref();
message.client.incrementMaxListeners();
message.client.on('interactionResponse', handler);