1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00
This commit is contained in:
InsanusMokrassar 2021-02-09 17:15:28 +06:00
parent 098b5cc393
commit 2a89c41a58
2 changed files with 17 additions and 3 deletions

View File

@ -7,6 +7,7 @@
* Now `AbstractRequestCallFactory` will set up one-second delay for zero timeouts in `GetUpdate` requests * Now `AbstractRequestCallFactory` will set up one-second delay for zero timeouts in `GetUpdate` requests
* Several extensions for `TelegramBotAPI` like `retrieveAccumulatedUpdates` have been added as a solution for * Several extensions for `TelegramBotAPI` like `retrieveAccumulatedUpdates` have been added as a solution for
[#293](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/293) [#293](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/293)
* Links for `tg://user?id=<user_id>` have been updated ([#292](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/292))
## 0.32.4 ## 0.32.4

View File

@ -1,5 +1,7 @@
package dev.inmo.tgbotapi.types package dev.inmo.tgbotapi.types
import dev.inmo.micro_utils.common.Warning
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder import kotlinx.serialization.encoding.Encoder
@ -17,9 +19,20 @@ data class ChatId(
val chatId: Identifier val chatId: Identifier
) : ChatIdentifier() ) : ChatIdentifier()
/**
val ChatId.link: String * https://core.telegram.org/bots/api#formatting-options
get() = "tg://user?id=$chatId" */
@Warning("This API have restrictions in Telegram System")
val Identifier.link: String
get() = "tg://user?id=$this"
/**
* https://core.telegram.org/bots/api#formatting-options
*/
@Warning("This API have restrictions in Telegram System")
val UserId.link: String
get() = chatId.link
val User.link: String
get() = id.link
typealias UserId = ChatId typealias UserId = ChatId