DateTimeEntityFormatting

@Serializable
value class DateTimeEntityFormatting(val string: String)(source)

A format string sent as the date_time_format wire value for a Telegram date-time entity.

Telegram requires the value to match r|w?[dD]?[tT]?; the complete format specification is available in the Telegram Bot API documentation. An empty value preserves the entity text as supplied while still allowing clients to expose the associated date in the user's local format. LOCAL_CONTROL_KEY requests a relative-time display and cannot be combined with another control key. The remaining keys optionally add a localized weekday, a short or long date, and a short or long time.

Prefer local or invoke when constructing a supported value. The public constructor accepts a custom string for forward compatibility, but unsupported combinations can violate Telegram's strict format and can consequently be rejected or rendered unexpectedly.

Constructors

Link copied to clipboard
constructor(string: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Exact string serialized as date_time_format.

Link copied to clipboard

true when string contains DATE_LONG_CONTROL_KEY, false when string contains only DATE_SHORT_CONTROL_KEY, or null when neither date key is present.

Link copied to clipboard

Whether string contains LOCAL_CONTROL_KEY, which requests a relative-time display.

Link copied to clipboard

true when string contains TIME_LONG_CONTROL_KEY, false when string contains only TIME_SHORT_CONTROL_KEY, or null when neither time key is present.

Link copied to clipboard

Whether string contains WEEK_CONTROL_KEY, which requests the localized weekday.

Functions

Link copied to clipboard
open override fun toString(): String