1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-16 13:49:26 +00:00

deeplinking fixes and additions

This commit is contained in:
2022-02-07 18:08:06 +06:00
parent b2bc47ec04
commit 1ebaa1c387
3 changed files with 18 additions and 1 deletions

View File

@@ -46,6 +46,9 @@ fun Byte.toChatId(): ChatId = toLong().toChatId()
data class Username(
val username: String
) : ChatIdentifier() {
val usernameWithoutAt
get() = username.dropWhile { it == '@' }
init {
if (!username.startsWith("@")) {
throw IllegalArgumentException("Username must starts with `@`")