twilight_validate::request

Function nickname

source
pub fn nickname(nickname: impl AsRef<str>) -> Result<(), ValidationError>
Expand description

Ensure that the nickname length is correct.

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

ยงErrors

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