mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-14 21:00:15 +00:00
improvements in Username
This commit is contained in:
@@ -87,12 +87,16 @@ fun Byte.toChatId(): IdChatIdentifier = toLong().toChatId()
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@JvmInline
|
||||
value class Username(
|
||||
@Deprecated("Renamed", ReplaceWith("full"))
|
||||
val username: String
|
||||
) : ChatIdentifier {
|
||||
val usernameWithoutAt
|
||||
get() = username.dropWhile { it == '@' }
|
||||
val full: String
|
||||
get() = username
|
||||
val withoutAt
|
||||
get() = full.dropWhile { it == '@' }
|
||||
@Deprecated("Renamed", ReplaceWith("withoutAt"))
|
||||
val usernameWithoutAt
|
||||
get() = withoutAt
|
||||
|
||||
init {
|
||||
if (!username.startsWith("@")) {
|
||||
|
Reference in New Issue
Block a user