Skip to content

Commit 69378b0

Browse files
committed
Added the class AcceptedGiftTypes and the method setBusinessAccountGiftSettings, allowing bots to change the privacy settings pertaining to incoming gifts in a managed business account.
1 parent 8ca20cf commit 69378b0

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.pengrad.telegrambot.model.gift
2+
3+
data class AcceptedGiftTypes(
4+
@get:JvmName("unlimitedGifts") val unlimitedGifts: Boolean,
5+
@get:JvmName("limitedGifts") val limitedGifts: Boolean,
6+
@get:JvmName("uniqueGifts") val uniqueGifts: Boolean,
7+
@get:JvmName("premiumSubscription") val premiumSubscription: Boolean
8+
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.pengrad.telegrambot.request.business
2+
3+
import com.pengrad.telegrambot.model.gift.AcceptedGiftTypes
4+
import com.pengrad.telegrambot.request.KBaseRequest
5+
import com.pengrad.telegrambot.response.BaseResponse
6+
import com.pengrad.telegrambot.utility.kotlin.requestParameter
7+
8+
@Suppress("unused")
9+
class SetBusinessAccountGiftSettings(
10+
businessConnectionId: String,
11+
showGiftButton: Boolean,
12+
acceptedGiftTypes: AcceptedGiftTypes
13+
): KBaseRequest<SetBusinessAccountGiftSettings, BaseResponse>(BaseResponse::class) {
14+
15+
val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
16+
val showGiftButton: Boolean by requestParameter(showGiftButton, customParameterName = "show_gift_button")
17+
val acceptedGiftTypes: AcceptedGiftTypes by requestParameter(acceptedGiftTypes, customParameterName = "accepted_gift_types")
18+
19+
}

0 commit comments

Comments
 (0)