1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-03-03 09:22:22 +00:00

check new fields and other things related to api updates in gifts

This commit is contained in:
2026-02-20 17:49:16 +06:00
parent f10cfdbe1e
commit c9be5041b8
17 changed files with 824 additions and 183 deletions

View File

@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.GetBusinessAccountGifts
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.OwnedGifts
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlin.runCatching
@@ -21,7 +21,7 @@ public suspend fun TelegramBot.getBusinessAccountGifts(
sortByPrice: Boolean = false,
offset: String? = null,
limit: Int? = null
): OwnedGifts<GiftSentOrReceived.ReceivedInBusinessAccount> = execute(
): OwnedGifts<GiftSentOrReceivedEvent.ReceivedInBusinessAccount> = execute(
GetBusinessAccountGifts(
businessConnectionId,
excludeUnsaved,
@@ -71,7 +71,7 @@ public fun TelegramBot.getBusinessAccountGiftsFlow(
initialOffset: String? = null,
limit: Int? = null,
onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false }
): Flow<OwnedGifts<GiftSentOrReceived.ReceivedInBusinessAccount>> = flow {
): Flow<OwnedGifts<GiftSentOrReceivedEvent.ReceivedInBusinessAccount>> = flow {
var currentOffset = initialOffset
do {
val response = runCatching {

View File

@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.gifts.GetChatGifts
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.OwnedGifts
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
@@ -20,7 +20,7 @@ public suspend fun TelegramBot.getChatGifts(
sortByPrice: Boolean = false,
offset: String? = null,
limit: Int? = null
): OwnedGifts<GiftSentOrReceived> = execute(
): OwnedGifts<GiftSentOrReceivedEvent> = execute(
GetChatGifts(
chatId,
excludeUnsaved,
@@ -49,7 +49,7 @@ public fun TelegramBot.getChatGiftsFlow(
initialOffset: String? = null,
limit: Int? = null,
onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false }
): Flow<OwnedGifts<GiftSentOrReceived>> = flow {
): Flow<OwnedGifts<GiftSentOrReceivedEvent>> = flow {
var currentOffset = initialOffset
do {
val response = runCatching {

View File

@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.gifts.GetUserGifts
import dev.inmo.tgbotapi.types.OwnedGifts
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
@@ -18,7 +18,7 @@ public suspend fun TelegramBot.getUserGifts(
sortByPrice: Boolean = false,
offset: String? = null,
limit: Int? = null
): OwnedGifts<GiftSentOrReceived> = execute(
): OwnedGifts<GiftSentOrReceivedEvent> = execute(
GetUserGifts(
userId,
excludeUnlimited,
@@ -43,7 +43,7 @@ public fun TelegramBot.getUserGiftsFlow(
initialOffset: String? = null,
limit: Int? = null,
onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false }
): Flow<OwnedGifts<GiftSentOrReceived>> = flow {
): Flow<OwnedGifts<GiftSentOrReceivedEvent>> = flow {
var currentOffset = initialOffset
do {
val response = runCatching {