Skip to content

Commit 8ca20cf

Browse files
committed
Added the methods setBusinessAccountProfilePhoto and removeBusinessAccountProfilePhoto, allowing bots to change the profile photo of a managed business account.
1 parent 0f301c4 commit 8ca20cf

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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 RemoveBusinessAccountProfilePhoto private constructor(
10+
businessConnectionId: String,
11+
isPublic: Boolean?
12+
) : KBaseRequest<RemoveBusinessAccountProfilePhoto, BaseResponse>(BaseResponse::class) {
13+
14+
constructor(businessConnectionId: String) : this(
15+
businessConnectionId = businessConnectionId,
16+
isPublic = null
17+
)
18+
19+
val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
20+
21+
var isPublic: Boolean? by optionalRequestParameter(isPublic, customParameterName = "is_public")
22+
fun isPublic(isPublic: Boolean) = applySelf { this.isPublic = isPublic }
23+
24+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.pengrad.telegrambot.request.business
2+
3+
import com.pengrad.telegrambot.model.inputprofilephoto.InputProfilePhoto
4+
import com.pengrad.telegrambot.request.KBaseRequest
5+
import com.pengrad.telegrambot.response.BaseResponse
6+
import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
7+
import com.pengrad.telegrambot.utility.kotlin.requestParameter
8+
9+
@Suppress("unused")
10+
class SetBusinessAccountProfilePhoto private constructor(
11+
businessConnectionId: String,
12+
photo: InputProfilePhoto,
13+
isPublic: Boolean?
14+
) : KBaseRequest<SetBusinessAccountProfilePhoto, BaseResponse>(BaseResponse::class) {
15+
16+
constructor(businessConnectionId: String, photo: InputProfilePhoto) : this(
17+
businessConnectionId = businessConnectionId,
18+
photo = photo,
19+
isPublic = null
20+
)
21+
22+
val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
23+
val photo: InputProfilePhoto by requestParameter(photo, customParameterName = "photo")
24+
25+
var isPublic: Boolean? by optionalRequestParameter(isPublic, customParameterName = "is_public")
26+
fun isPublic(isPublic: Boolean) = applySelf { this.isPublic = isPublic }
27+
28+
}

0 commit comments

Comments
 (0)