Skip to content

Commit af685a6

Browse files
committed
Added the method transferGift, allowing bots to transfer unique gifts owned by a managed business account.
1 parent e5697dc commit af685a6

File tree

1 file changed

+30
-0
lines changed
  • library/src/main/java/com/pengrad/telegrambot/request/business

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.pengrad.telegrambot.request.business
2+
3+
import com.pengrad.telegrambot.request.KBaseRequest
4+
import com.pengrad.telegrambot.response.BaseResponse
5+
import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
6+
import com.pengrad.telegrambot.utility.kotlin.requestParameter
7+
8+
@Suppress("unused")
9+
class TransferGift private constructor(
10+
businessConnectionId: String,
11+
ownedGiftId: String,
12+
newOwnerChatId: Long,
13+
starCount: Int?
14+
): KBaseRequest<TransferGift, BaseResponse>(BaseResponse::class) {
15+
16+
constructor(businessConnectionId: String, ownedGiftId: String, newOwnerChatId: Long) : this(
17+
businessConnectionId = businessConnectionId,
18+
ownedGiftId = ownedGiftId,
19+
newOwnerChatId = newOwnerChatId,
20+
starCount = null
21+
)
22+
23+
val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
24+
val ownedGiftId: String by requestParameter(ownedGiftId, customParameterName = "owned_gift_id")
25+
val newOwnerChatId: Long by requestParameter(newOwnerChatId, customParameterName = "new_owner_chat_id")
26+
27+
var starCount: Int? by optionalRequestParameter(starCount, customParameterName = "star_count")
28+
fun starCount(starCount: Int) = applySelf { this.starCount = starCount }
29+
30+
}

0 commit comments

Comments
 (0)