diff --git a/CHANGELOG.md b/CHANGELOG.md index 399724d00a..3174454390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * `SwitchInlineQueryCurrentChatInlineKeyboardButton#switchInlineQueryCurrentChat` field fixed * `InlineKeyboardButton` now is sealed class and all its possible realisations are inside of its class file * `String#asUsername` method renamed to `String#toUsername` +* Several `toChatId` extensions added ## 0.15.0 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatIdentifier.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatIdentifier.kt index 7877fe3fcd..c1d5928304 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatIdentifier.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatIdentifier.kt @@ -20,6 +20,8 @@ val ChatId.link: String typealias UserId = ChatId fun Identifier.toChatId(): ChatId = ChatId(this) +fun Int.toChatId(): ChatId = toLong().toChatId() +fun Byte.toChatId(): ChatId = toLong().toChatId() @Serializable(ChatIdentifierSerializer::class) data class Username(