twilight_validate::component

Function component

source
pub fn component(component: &Component) -> Result<(), ComponentValidationError>
Expand description

Ensure that a top-level request component is correct.

Intended to ensure that a fully formed top-level component for requests is an action row.

Refer to other validators like button if you need to validate other components.

ยงErrors

Returns an error of type InvalidRootComponent if the component is not an ActionRow.

Refer to action_row for potential errors when validating an action row component.