twilight_validate::request

Function template_name

Source
pub fn template_name(name: impl AsRef<str>) -> Result<(), ValidationError>
Expand description

Ensure that a guild template’s name length is correct.

The length must be at least TEMPLATE_NAME_LENGTH_MIN and at most TEMPLATE_NAME_LENGTH_MAX. This is based on this documentation entry.

§Errors

Returns an error of type TemplateName if the length is invalid.