1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-04-19 00:12:34 +00:00

Compare commits

..

9 Commits

8 changed files with 18 additions and 32 deletions

View File

@@ -1,5 +1,13 @@
# TelegramBotAPI changelog
## 7.1.1
* `Versions`:
* `Kotlin`: `1.8.20` -> `1.8.21`
* `MicroUtils`: `0.17.8` -> `0.18.0`
* `Utils`:
* Fixes in `makeLinkToMessage`
## 7.1.0
**This update contains changes according to the [Telegram Bot API 6.7](https://core.telegram.org/bots/api-changelog#april-21-2023)**

View File

@@ -5,7 +5,7 @@
| Useful repos | [![Create bot](https://img.shields.io/static/v1?label=Github&message=Template&color=blue&logo=github)](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [![Examples](https://img.shields.io/static/v1?label=Github&message=Examples&color=blue&logo=github)](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/) |
| Misc | [![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin) [![Small survey](https://img.shields.io/static/v1?label=Google&message=Survey&color=blue&logo=google-sheets)](https://docs.google.com/forms/d/e/1FAIpQLSctdJHT_aEniyYT0-IUAEfo1hsIlezX2owlkEAYX4KPl2V2_A/viewform?usp=sf_link) |
| Platforms | ![JVM](https://img.shields.io/badge/JVM-red?style=plastic&logo=openjdk&logoColor=white) ![Js](https://img.shields.io/badge/JavaScript-323330?style=plastic&logo=javascript&logoColor=F7DF1E) |
| Experimental Platforms | ![Linux x64](https://img.shields.io/badge/LinuxX64-FCC624?style=plastic&logo=linux&logoColor=black) ![MinGW x64](https://img.shields.io/badge/MinGWX64-black?style=plastic&logo=windows&logoColor=green) |
| Experimental Platforms | [![Linux x64](https://img.shields.io/badge/LinuxX64-FCC624?style=plastic&logo=linux&logoColor=black)](https://kotlinlang.org/docs/native-target-support.html#tier-1) [![MinGW x64](https://img.shields.io/badge/MinGWX64-black?style=plastic&logo=windows&logoColor=green)](https://kotlinlang.org/docs/native-target-support.html#tier-1) |
<!--- [![Telegram Channel](./resources/tg_channel_qr.jpg)](https://t.me/ktgbotapi) --->

View File

@@ -6,4 +6,4 @@ kotlin.incremental=true
kotlin.incremental.js=true
library_group=dev.inmo
library_version=7.1.0
library_version=7.1.1

View File

@@ -1,6 +1,6 @@
[versions]
kotlin = "1.8.20"
kotlin = "1.8.21"
kotlin-serialization = "1.5.0"
kotlin-coroutines = "1.6.4"
@@ -10,10 +10,10 @@ korlibs = "3.4.0"
uuid = "0.7.0"
ktor = "2.3.0"
ksp = "1.8.20-1.0.11"
kotlin-poet = "1.13.0"
ksp = "1.8.21-1.0.11"
kotlin-poet = "1.13.1"
microutils = "0.17.8"
microutils = "0.18.0"
github-release-plugin = "2.4.1"
dokka = "1.8.10"

View File

@@ -14,7 +14,6 @@ object ExceptionsOnlyLimiter : RequestLimiter {
result = runCatchingSafely {
block()
}.onFailure {
it.printStackTrace()
if (it is TooMuchRequestsException) {
delay(it.retryAfter.leftToRetry)
} else {

View File

@@ -14,11 +14,11 @@ const val UPDATE_POLL_ANSWER = "poll_answer"
const val UPDATE_MY_CHAT_MEMBER = "my_chat_member"
const val UPDATE_CHAT_MEMBER = "chat_member"
const val UPDATE_CHAT_JOIN_REQUEST = "chat_join_request"
@Deprecated("Renamed", ReplaceWith("UPDATE_MY_CHAT_MEMBER"))
@Deprecated("Renamed", ReplaceWith("UPDATE_MY_CHAT_MEMBER", "dev.inmo.tgbotapi.types.UPDATE_MY_CHAT_MEMBER"))
const val MY_CHAT_MEMBER = UPDATE_MY_CHAT_MEMBER
@Deprecated("Renamed", ReplaceWith("UPDATE_CHAT_MEMBER"))
@Deprecated("Renamed", ReplaceWith("UPDATE_CHAT_MEMBER", "dev.inmo.tgbotapi.types.UPDATE_CHAT_MEMBER"))
const val CHAT_MEMBER = UPDATE_CHAT_MEMBER
@Deprecated("Renamed", ReplaceWith("UPDATE_CHAT_JOIN_REQUEST"))
@Deprecated("Renamed", ReplaceWith("UPDATE_CHAT_JOIN_REQUEST", "dev.inmo.tgbotapi.types.UPDATE_CHAT_JOIN_REQUEST"))
const val CHAT_JOIN_REQUEST = UPDATE_CHAT_JOIN_REQUEST
val ALL_UPDATES_LIST = listOf(

View File

@@ -16,8 +16,6 @@ import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton
import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink
import dev.inmo.tgbotapi.requests.send.payments.SendInvoice
import dev.inmo.tgbotapi.requests.stickers.InputSticker
import dev.inmo.tgbotapi.types.ChatFolderInviteLink
import dev.inmo.tgbotapi.types.ChatFolderInviteLinkUnlimited
import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.ChatIdWithThreadId
import dev.inmo.tgbotapi.types.ChatIdentifier
@@ -563,25 +561,6 @@ public inline fun WithUser.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlim
public inline fun <T> WithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T?
= chatInviteLinkUnlimitedOrNull() ?.let(block)
public inline fun WithUser.chatFolderInviteLinkOrNull(): ChatFolderInviteLink? = this as?
dev.inmo.tgbotapi.types.ChatFolderInviteLink
public inline fun WithUser.chatFolderInviteLinkOrThrow(): ChatFolderInviteLink = this as
dev.inmo.tgbotapi.types.ChatFolderInviteLink
public inline fun <T> WithUser.ifChatFolderInviteLink(block: (ChatFolderInviteLink) -> T): T? =
chatFolderInviteLinkOrNull() ?.let(block)
public inline fun WithUser.chatFolderInviteLinkUnlimitedOrNull(): ChatFolderInviteLinkUnlimited? =
this as? dev.inmo.tgbotapi.types.ChatFolderInviteLinkUnlimited
public inline fun WithUser.chatFolderInviteLinkUnlimitedOrThrow(): ChatFolderInviteLinkUnlimited =
this as dev.inmo.tgbotapi.types.ChatFolderInviteLinkUnlimited
public inline fun <T>
WithUser.ifChatFolderInviteLinkUnlimited(block: (ChatFolderInviteLinkUnlimited) -> T): T? =
chatFolderInviteLinkUnlimitedOrNull() ?.let(block)
public inline fun WithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as?
dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult

View File

@@ -47,7 +47,7 @@ fun makeLinkToMessage(
username: Username,
messageId: MessageId,
threadId: MessageThreadId? = null
): String = makeLinkToMessage(username.username, messageId, threadId)
): String = makeLinkToMessage(username.usernameWithoutAt, messageId, threadId)
fun makeLinkToMessage(
chatId: Identifier,
messageId: MessageId,