Username

value class Username(val full: String) : ChatIdentifier(source)

A value class representing a username that always starts with the "@" symbol.

This class is used to encapsulate the concept of a username, enforce its format, and ensure consistency when dealing with usernames throughout the application.

Throws

if the provided full value doesn't start with "@" during initialization.

Constructors

Link copied to clipboard
constructor(full: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns the embedded business connection, or null when no business connection is available.

Link copied to clipboard
Link copied to clipboard

Returns the embedded channel direct-message thread, or null when no direct-message thread is available.

Link copied to clipboard

Returns the embedded ephemeral-message identifier, or null when no identifier is available.

Link copied to clipboard

The full username string, guaranteed to start with "@".

Link copied to clipboard

Returns the embedded ephemeral-message receiver, or null when no receiver is available.

Link copied to clipboard
Link copied to clipboard

Returns the embedded message thread, or null when no message thread is available.

Link copied to clipboard

Retrieves the full username as a string.

Link copied to clipboard
Link copied to clipboard

A property that returns the username string without the leading "@" symbol.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T> ChatIdentifier.ifBusinessChatId(block: (BusinessChatId) -> T): T?
Link copied to clipboard
inline fun <T> ChatIdentifier.ifChatId(block: (ChatId) -> T): T?
Link copied to clipboard
Link copied to clipboard
inline fun <T> ChatIdentifier.ifEphemeralChatId(block: (EphemeralChatId) -> T): T?
Link copied to clipboard
Link copied to clipboard
inline fun <T> ChatIdentifier.ifUsername(block: (Username) -> T): T?
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard