fix: modals execution without .run (#268)

* fix: modals execution

* fix: lol
This commit is contained in:
Free 公園 2024-09-28 09:42:47 -06:00 committed by GitHub
parent 13b8a32d42
commit dd8fbd2789
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -239,9 +239,11 @@ export class BaseInteraction<
}
const result = await this.matchReplied(body, withResponse);
// @ts-expect-error
if (body.data instanceof Modal && body.data.__exec)
if (body.data instanceof Modal) {
// @ts-expect-error
this.client.components.modals.set(this.user.id, (body.data as Modal).__exec);
if (body.data.__exec) this.client.components.modals.set(this.user.id, (body.data as Modal).__exec);
else if (this.client.components?.modals.has(this.user.id)) this.client.components.modals.delete(this.user.id);
}
return result as never;
}