seyfert/src/components/ActionRow.ts
David 017ccfc3bf
fix: github actions (#210)
* fix: github actions

* fix: pnpm version

* fix: github actions checkout

* fix: brackets in failure function

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* chore: apply formatting

* fix: github actions

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-14 14:23:58 -04:00

22 lines
683 B
TypeScript

import type { APIMessageActionRowComponent, ComponentType } from 'discord-api-types/v10';
import { BaseComponent } from './BaseComponent';
import type { ActionRowMessageComponents } from './index';
import { componentFactory } from './index';
export class MessageActionRowComponent<
T extends ActionRowMessageComponents,
> extends BaseComponent<ComponentType.ActionRow> {
private ComponentsFactory: T[];
constructor(data: {
type: ComponentType.ActionRow;
components: APIMessageActionRowComponent[];
}) {
super(data);
this.ComponentsFactory = data.components.map(componentFactory) as T[];
}
get components() {
return this.ComponentsFactory;
}
}