Skip to content

Commit 3a941d9

Browse files
committed
Create RemoveChatVerification request
1 parent 9d56605 commit 3a941d9

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.pengrad.telegrambot.request
2+
3+
import com.pengrad.telegrambot.response.BaseResponse
4+
import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
5+
import com.pengrad.telegrambot.utility.kotlin.requestParameter
6+
7+
class RemoveChatVerification(
8+
chatId: Long?,
9+
channelUsername: String?
10+
) : KBaseRequest<RemoveChatVerification, BaseResponse>(BaseResponse::class) {
11+
12+
constructor(chatId: Long) : this(
13+
chatId = chatId,
14+
channelUsername = null
15+
)
16+
17+
constructor(channelUsername: String) : this(
18+
chatId = null,
19+
channelUsername = channelUsername
20+
)
21+
22+
val chatId: Long? by optionalRequestParameter(chatId, customParameterName = "chat_id")
23+
val channelUsername: String? by optionalRequestParameter(channelUsername, customParameterName = "chat_id")
24+
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.pengrad.telegrambot.utility.kotlin.extension.request
2+
3+
import com.pengrad.telegrambot.TelegramAware
4+
import com.pengrad.telegrambot.request.RemoveChatVerification
5+
import com.pengrad.telegrambot.request.RemoveUserVerification
6+
import com.pengrad.telegrambot.utility.kotlin.extension.execute
7+
8+
inline fun TelegramAware.removeChatVerification(
9+
chatId: Long,
10+
modifier: RemoveChatVerification.() -> Unit = {}
11+
) = this.execute(RemoveChatVerification(
12+
chatId = chatId
13+
), modifier)
14+
15+
inline fun TelegramAware.removeChatVerification(
16+
channelUsername: String,
17+
modifier: RemoveChatVerification.() -> Unit = {}
18+
) = this.execute(RemoveChatVerification(
19+
channelUsername = channelUsername
20+
), modifier)

0 commit comments

Comments
 (0)