mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-07-05 17:45:13 +00:00
Compare commits
10 Commits
df512a917b
...
29.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| b69c8f1d8f | |||
| fdf393405c | |||
| c951fc3353 | |||
| 02f42c3f52 | |||
| 0105e46a5f | |||
| 325a189ebb | |||
| 1d021c8450 | |||
| 6eb9379e0a | |||
| 2d97d10ee1 | |||
| 4b7d052ece |
2
.github/workflows/packages_publishing.yml
vendored
2
.github/workflows/packages_publishing.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_USER: ${{ github.actor }}
|
GITHUB_USER: ${{ github.actor }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Publish to Gitea
|
- name: Publish to InmoNexus
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
||||||
env:
|
env:
|
||||||
|
|||||||
18
CHANGELOG.md
18
CHANGELOG.md
@@ -1,7 +1,25 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 29.1.0
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `Gradle Versions Plugin`: `0.52.0` -> `0.53.0`
|
||||||
|
|
||||||
|
## 29.0.1
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Fix of [#917](https://github.com/InsanusMokrassar/ktgbotapi/issues/917): all `OrderInfo` fields now have defaults nulls
|
||||||
|
|
||||||
## 29.0.0
|
## 29.0.0
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.2](https://core.telegram.org/bots/api-changelog#august-15-2025)**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Add function `firstOfOrNull(vararg suspend () -> T): T?`
|
||||||
|
* Change logic of `firstOf` - now it works based on merged flows and __do not require__ `CoroutineScope` as receiver
|
||||||
|
|
||||||
## 28.0.3
|
## 28.0.3
|
||||||
|
|
||||||
* `Core`:
|
* `Core`:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# TelegramBotAPI [](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#july-3-2025)
|
# TelegramBotAPI [](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#august-15-2025)
|
||||||
|
|
||||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ kotlin.incremental.js=true
|
|||||||
ksp.useKSP2=false
|
ksp.useKSP2=false
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=29.0.0
|
library_version=29.1.0
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ kotlin-poet = "2.2.0"
|
|||||||
microutils = "0.26.3"
|
microutils = "0.26.3"
|
||||||
kslog = "1.5.0"
|
kslog = "1.5.0"
|
||||||
|
|
||||||
versions = "0.52.0"
|
versions = "0.53.0"
|
||||||
|
|
||||||
github-release-plugin = "2.5.2"
|
github-release-plugin = "2.5.2"
|
||||||
dokka = "2.0.0"
|
dokka = "2.0.0"
|
||||||
|
|||||||
@@ -28487,7 +28487,9 @@ public final class dev/inmo/tgbotapi/types/payments/LabeledPricesSerializer : ko
|
|||||||
|
|
||||||
public final class dev/inmo/tgbotapi/types/payments/OrderInfo {
|
public final class dev/inmo/tgbotapi/types/payments/OrderInfo {
|
||||||
public static final field Companion Ldev/inmo/tgbotapi/types/payments/OrderInfo$Companion;
|
public static final field Companion Ldev/inmo/tgbotapi/types/payments/OrderInfo$Companion;
|
||||||
|
public fun <init> ()V
|
||||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/payments/ShippingAddress;)V
|
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/payments/ShippingAddress;)V
|
||||||
|
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/payments/ShippingAddress;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||||
public final fun component1 ()Ljava/lang/String;
|
public final fun component1 ()Ljava/lang/String;
|
||||||
public final fun component2 ()Ljava/lang/String;
|
public final fun component2 ()Ljava/lang/String;
|
||||||
public final fun component3 ()Ljava/lang/String;
|
public final fun component3 ()Ljava/lang/String;
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ import kotlinx.serialization.Serializable
|
|||||||
@Serializable
|
@Serializable
|
||||||
data class OrderInfo(
|
data class OrderInfo(
|
||||||
@SerialName(nameField)
|
@SerialName(nameField)
|
||||||
val name: String?,
|
val name: String? = null,
|
||||||
@SerialName(phoneNumberField)
|
@SerialName(phoneNumberField)
|
||||||
val phoneNumber: String?,
|
val phoneNumber: String? = null,
|
||||||
@SerialName(emailField)
|
@SerialName(emailField)
|
||||||
val email: String?,
|
val email: String? = null,
|
||||||
@SerialName(shippingAddressField)
|
@SerialName(shippingAddressField)
|
||||||
val shippingAddress: ShippingAddress?
|
val shippingAddress: ShippingAddress? = null
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.utils
|
package dev.inmo.tgbotapi.utils
|
||||||
|
|
||||||
|
import kotlinx.coroutines.flow.first
|
||||||
import kotlinx.coroutines.flow.firstOrNull
|
import kotlinx.coroutines.flow.firstOrNull
|
||||||
import kotlinx.coroutines.flow.flow
|
import kotlinx.coroutines.flow.flow
|
||||||
import kotlinx.coroutines.flow.merge
|
import kotlinx.coroutines.flow.merge
|
||||||
@@ -53,5 +54,16 @@ suspend fun <T> firstOfOrNull(
|
|||||||
suspend fun <T> firstOf(
|
suspend fun <T> firstOf(
|
||||||
vararg deferreds: suspend () -> T
|
vararg deferreds: suspend () -> T
|
||||||
): T {
|
): T {
|
||||||
return firstOfOrNull(*deferreds) ?: error("Unable to get result of deferreds")
|
val resultFlow = deferreds.map {
|
||||||
|
flow {
|
||||||
|
runCatching {
|
||||||
|
it()
|
||||||
|
}.onSuccess {
|
||||||
|
emit(it)
|
||||||
|
}.onFailure {
|
||||||
|
if (it is CancellationException) throw it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.merge()
|
||||||
|
return resultFlow.first()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user