Expand description
Input validation helpers.
Functionsยง
- validate_
alt_ text - Validate alt text length.
- validate_
carousel_ children - Validate carousel child count is between
MIN_CAROUSEL_ITEMSandMAX_CAROUSEL_ITEMSinclusive. - validate_
country_ codes - Validate country codes: each must be exactly 2 alphabetic ASCII characters.
- validate_
gif_ attachment - Validate a GIF attachment:
gif_idmust be non-empty andprovidermust be a known variant (enforced at the type level byGifProvider). - validate_
limit - Validate that an optional limit does not exceed
MAX_POSTS_PER_REQUEST. - validate_
link_ count - Validate that the combined unique link count from
textandlink_attachment_urldoes not exceedMAX_LINKS. - validate_
media_ url - Validate a media URL: must be non-empty and start with
http://orhttps://. - validate_
pagination_ options - Validate pagination options: limit must not exceed
MAX_POSTS_PER_REQUEST, andbeforeandaftercannot both be set. - validate_
pending_ replies_ options - Validate pending replies options: limit and before/after exclusivity.
- validate_
poll_ attachment - Validate poll attachment options.
- validate_
posts_ options - Validate posts options: limit, since <= until ordering, and before/after exclusivity.
- validate_
replies_ options - Validate replies options: limit and before/after exclusivity.
- validate_
search_ options - Validate search options: limit, since timestamp, since <= until ordering, and before/after exclusivity.
- validate_
text_ attachment - Validate a text attachment: plaintext length and styling ranges.
- validate_
text_ entities - Validate text entities: at most
MAX_TEXT_ENTITIES, each must be SPOILER type, and offsets must be non-negative (enforced byusize). - validate_
text_ length - Validate that
textdoes not exceedMAX_TEXT_LENGTHcharacters. - validate_
topic_ tag - Validate a topic tag: must be 1-50 characters and not contain periods (
.) or ampersands (&).