mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-03 23:29:33 +00:00
improvements in KeyboardButtonRequestChat
This commit is contained in:
@@ -249,3 +249,57 @@ inline fun ReplyKeyboardRowBuilder.requestChatButton(
|
||||
botIsMember = botIsMember
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Creates and put [RequestChatKeyboardButton] with [KeyboardButtonRequestChat.Channel]
|
||||
*
|
||||
* @see replyKeyboard
|
||||
* @see ReplyKeyboardBuilder.row
|
||||
*/
|
||||
inline fun ReplyKeyboardRowBuilder.requestChannelButton(
|
||||
text: String,
|
||||
requestId: RequestId,
|
||||
isPublic: Boolean? = null,
|
||||
isOwnedBy: Boolean? = null,
|
||||
userRightsInChat: ChatAdministratorRights? = null,
|
||||
botRightsInChat: ChatAdministratorRights? = null,
|
||||
botIsMember: Boolean? = null
|
||||
) = requestChatButton(
|
||||
text,
|
||||
KeyboardButtonRequestChat.Channel(
|
||||
requestId = requestId,
|
||||
isPublic = isPublic,
|
||||
isOwnedBy = isOwnedBy,
|
||||
userRightsInChat = userRightsInChat,
|
||||
botRightsInChat = botRightsInChat,
|
||||
botIsMember = botIsMember
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Creates and put [RequestChatKeyboardButton] with [KeyboardButtonRequestChat.Group]
|
||||
*
|
||||
* @see replyKeyboard
|
||||
* @see ReplyKeyboardBuilder.row
|
||||
*/
|
||||
inline fun ReplyKeyboardRowBuilder.requestGroupButton(
|
||||
text: String,
|
||||
requestId: RequestId,
|
||||
isForum: Boolean? = null,
|
||||
isPublic: Boolean? = null,
|
||||
isOwnedBy: Boolean? = null,
|
||||
userRightsInChat: ChatAdministratorRights? = null,
|
||||
botRightsInChat: ChatAdministratorRights? = null,
|
||||
botIsMember: Boolean? = null
|
||||
) = requestChatButton(
|
||||
text,
|
||||
KeyboardButtonRequestChat.Group(
|
||||
requestId = requestId,
|
||||
isForum = isForum,
|
||||
isPublic = isPublic,
|
||||
isOwnedBy = isOwnedBy,
|
||||
userRightsInChat = userRightsInChat,
|
||||
botRightsInChat = botRightsInChat,
|
||||
botIsMember = botIsMember
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user