fix: default props in components (#202)

This commit is contained in:
Marcos Susaña 2024-06-06 11:23:01 -04:00 committed by GitHub
parent 71763d11d9
commit 9a942e8674
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,6 +173,7 @@ export class ComponentHandler extends BaseHandler {
continue;
}
if (!(component instanceof ModalCommand || component instanceof ComponentCommand)) continue;
component.props ??= this.client.options.commands?.defaults?.props ?? {};
if (component instanceof ModalCommand) {
component.onInternalError ??= this.client.options?.modals?.defaults?.onInternalError;
component.onMiddlewaresError ??= this.client.options?.modals?.defaults?.onMiddlewaresError;