feat(TextChannel): add searchInteraction

This commit is contained in:
March 7th
2022-10-30 19:25:32 +07:00
parent 91ae4195a6
commit a6459f2c14
12 changed files with 75 additions and 105 deletions
+18 -4
View File
@@ -873,8 +873,15 @@ class ApplicationCommand extends Base {
clearTimeout(timeout);
this.client.removeListener('interactionResponse', handler);
this.client.decrementMaxListeners();
if (data.status) resolve(data.metadata);
else reject(data.metadata);
if (data.status) {
resolve(data.metadata);
} else {
reject(
new Error('INTERACTION_ERROR', {
cause: data,
}),
);
}
};
const timeout = setTimeout(() => {
this.client.removeListener('interactionResponse', handler);
@@ -958,8 +965,15 @@ class ApplicationCommand extends Base {
clearTimeout(timeout);
this.client.removeListener('interactionResponse', handler);
this.client.decrementMaxListeners();
if (data.status) resolve(data.metadata);
else reject(data.metadata);
if (data.status) {
resolve(data.metadata);
} else {
reject(
new Error('INTERACTION_ERROR', {
cause: data,
}),
);
}
};
const timeout = setTimeout(() => {
this.client.removeListener('interactionResponse', handler);