mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-11-02 01:42:56 +00:00
Add Bot API 10.3 Reply markup support
This commit is contained in:
1 parent
752689447b
commit
efd4667ffa
15 files changed
+247
-36
No files matched your search
@@ -1385,6 +1385,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun directMessagesConfigurationChangedPaidOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/DirectMessagesConfigurationChanged$Paid;
|
||||
public static final fun directMessagesTopicOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/DirectMessagesTopic;
|
||||
public static final fun directMessagesTopicOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/DirectMessagesTopic;
|
||||
public static final fun disabledInlineKeyboardButtonOrNull (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/DisabledInlineKeyboardButton;
|
||||
public static final fun disabledInlineKeyboardButtonOrThrow (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/DisabledInlineKeyboardButton;
|
||||
public static final fun disabledOrNull (Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection;)Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection$Disabled;
|
||||
public static final fun disabledOrThrow (Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection;)Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection$Disabled;
|
||||
public static final fun documentContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/DocumentContent;
|
||||
@@ -1770,6 +1772,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun ifDirectMessagesConfigurationChangedPaid (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifDirectMessagesTopic (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifDisabled (Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifDisabledInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifDocumentContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifDocumentFile (Ldev/inmo/tgbotapi/types/media/BaseTelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifDocumentMediaGroupMemberTelegramMedia (Ldev/inmo/tgbotapi/types/media/TelegramMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -4019,17 +4022,22 @@ public final class dev/inmo/tgbotapi/extensions/utils/shortcuts/RequestsExecutor
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/utils/types/buttons/InlineKeyboardBuilderKt {
|
||||
public static final fun build (Ldev/inmo/tgbotapi/utils/MatrixBuilder;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static final fun build (Ldev/inmo/tgbotapi/utils/MatrixBuilder;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static synthetic fun build$default (Ldev/inmo/tgbotapi/utils/MatrixBuilder;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static final fun copyTextButton-TGGzX2M (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/CopyTextButtonData;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
public static final fun copyTextButton-TGGzX2M (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
public static synthetic fun copyTextButton-TGGzX2M$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/CopyTextButtonData;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static synthetic fun copyTextButton-TGGzX2M$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static final fun dataButton-TGGzX2M (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
public static synthetic fun dataButton-TGGzX2M$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static final fun flatInlineKeyboard (Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static final fun disabledButton-peVxY-Q (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
public static synthetic fun disabledButton-peVxY-Q$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static final fun flatInlineKeyboard (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static synthetic fun flatInlineKeyboard$default (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static final fun gameButton-peVxY-Q (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
public static synthetic fun gameButton-peVxY-Q$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static final fun inlineKeyboard (Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static final fun inlineKeyboard (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static synthetic fun inlineKeyboard$default (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static final fun inlineQueryButton-TGGzX2M (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
public static synthetic fun inlineQueryButton-TGGzX2M$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static final fun inlineQueryInAnyChosenChatButton-TGGzX2M (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
@@ -4042,7 +4050,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/types/buttons/InlineKeyboa
|
||||
public static synthetic fun inlineQueryInCurrentChatButton-TGGzX2M$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static final fun loginButton-TGGzX2M (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/LoginURL;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
public static synthetic fun loginButton-TGGzX2M$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/LoginURL;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static final fun modified (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static final fun modified (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static synthetic fun modified$default (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static final fun payButton-peVxY-Q (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
public static synthetic fun payButton-peVxY-Q$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static final fun urlButton-TGGzX2M (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
@@ -4054,16 +4063,17 @@ public final class dev/inmo/tgbotapi/extensions/utils/types/buttons/InlineKeyboa
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/utils/types/buttons/InlineKeyboardMarkupKt {
|
||||
public static final fun InlineKeyboardMarkup ([Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static final fun InlineKeyboardMarkup ([Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public static synthetic fun InlineKeyboardMarkup$default ([Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilderKt {
|
||||
public static final fun build (Ldev/inmo/tgbotapi/utils/MatrixBuilder;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static synthetic fun build$default (Ldev/inmo/tgbotapi/utils/MatrixBuilder;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static final fun flatReplyKeyboard (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static synthetic fun flatReplyKeyboard$default (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static final fun replyKeyboard (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static synthetic fun replyKeyboard$default (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static final fun build (Ldev/inmo/tgbotapi/utils/MatrixBuilder;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static synthetic fun build$default (Ldev/inmo/tgbotapi/utils/MatrixBuilder;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static final fun flatReplyKeyboard (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static synthetic fun flatReplyKeyboard$default (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static final fun replyKeyboard (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static synthetic fun replyKeyboard$default (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static final fun requestBotButton-saVQPX0 (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
public static synthetic fun requestBotButton-saVQPX0$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;ILjava/lang/Object;)Z
|
||||
public static final fun requestBotsButton-gB4qrME (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SILjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonStyle;)Z
|
||||
@@ -4105,8 +4115,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboar
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardMarkupKt {
|
||||
public static final fun ReplyKeyboardMarkup ([Ldev/inmo/tgbotapi/types/buttons/KeyboardButton;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static synthetic fun ReplyKeyboardMarkup$default ([Ldev/inmo/tgbotapi/types/buttons/KeyboardButton;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static final fun ReplyKeyboardMarkup ([Ldev/inmo/tgbotapi/types/buttons/KeyboardButton;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
public static synthetic fun ReplyKeyboardMarkup$default ([Ldev/inmo/tgbotapi/types/buttons/KeyboardButton;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/utils/types/files/ContentAsMultipartFileKt {
|
||||
|
||||
+7
@@ -121,6 +121,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CopyTextButton
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.DisabledInlineKeyboardButton
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.InlineKeyboardButton
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton
|
||||
@@ -4237,6 +4238,12 @@ public inline fun KeyboardButtonRequestUsers.botOrThrow(): KeyboardButtonRequest
|
||||
|
||||
public inline fun <T> KeyboardButtonRequestUsers.ifBot(block: (KeyboardButtonRequestUsers.Bot) -> T): T? = botOrNull() ?.let(block)
|
||||
|
||||
public inline fun InlineKeyboardButton.disabledInlineKeyboardButtonOrNull(): DisabledInlineKeyboardButton? = this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.DisabledInlineKeyboardButton
|
||||
|
||||
public inline fun InlineKeyboardButton.disabledInlineKeyboardButtonOrThrow(): DisabledInlineKeyboardButton = this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.DisabledInlineKeyboardButton
|
||||
|
||||
public inline fun <T> InlineKeyboardButton.ifDisabledInlineKeyboardButton(block: (DisabledInlineKeyboardButton) -> T): T? = disabledInlineKeyboardButtonOrNull() ?.let(block)
|
||||
|
||||
public inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrNull(): UnknownInlineKeyboardButton? = this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton
|
||||
|
||||
public inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrThrow(): UnknownInlineKeyboardButton = this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton
|
||||
|
||||
+21
-4
@@ -20,7 +20,9 @@ typealias InlineKeyboardBuilder = MatrixBuilder<InlineKeyboardButton>
|
||||
/**
|
||||
* Creates [InlineKeyboardMarkup] using internal [matrix]
|
||||
*/
|
||||
fun InlineKeyboardBuilder.build() = InlineKeyboardMarkup(matrix)
|
||||
fun InlineKeyboardBuilder.build(
|
||||
forceReply: Boolean? = null
|
||||
) = InlineKeyboardMarkup(matrix, forceReply)
|
||||
|
||||
/**
|
||||
* Row builder of [InlineKeyboardBuilder]
|
||||
@@ -37,8 +39,9 @@ typealias InlineKeyboardRowBuilder = RowBuilder<InlineKeyboardButton>
|
||||
* @see InlineKeyboardBuilder.row
|
||||
*/
|
||||
inline fun inlineKeyboard(
|
||||
forceReply: Boolean? = null,
|
||||
block: InlineKeyboardBuilder.() -> Unit
|
||||
) = InlineKeyboardBuilder().apply(block).build()
|
||||
) = InlineKeyboardBuilder().apply(block).build(forceReply)
|
||||
|
||||
/**
|
||||
* Factory-function for [InlineKeyboardBuilder], but in difference with [inlineKeyboard] this function will create single-row
|
||||
@@ -47,8 +50,9 @@ inline fun inlineKeyboard(
|
||||
* @see InlineKeyboardBuilder.row
|
||||
*/
|
||||
inline fun flatInlineKeyboard(
|
||||
forceReply: Boolean? = null,
|
||||
block: InlineKeyboardRowBuilder.() -> Unit
|
||||
) = inlineKeyboard { row<InlineKeyboardButton>(block) }
|
||||
) = inlineKeyboard(forceReply) { row<InlineKeyboardButton>(block) }
|
||||
|
||||
/**
|
||||
* Factory-function for [InlineKeyboardBuilder]. It will [apply] [block] to internally created [InlineKeyboardMarkup]
|
||||
@@ -57,11 +61,24 @@ inline fun flatInlineKeyboard(
|
||||
* @see InlineKeyboardBuilder.row
|
||||
*/
|
||||
inline fun InlineKeyboardMarkup.modified(
|
||||
forceReply: Boolean? = this.forceReply,
|
||||
block: InlineKeyboardBuilder.() -> Unit
|
||||
) = InlineKeyboardBuilder().apply {
|
||||
keyboard.forEach { add(it) }
|
||||
block()
|
||||
}.build()
|
||||
}.build(forceReply)
|
||||
|
||||
/**
|
||||
* Creates and puts [DisabledInlineKeyboardButton].
|
||||
*
|
||||
* @see inlineKeyboard
|
||||
* @see InlineKeyboardBuilder.row
|
||||
*/
|
||||
fun InlineKeyboardRowBuilder.disabledButton(
|
||||
text: String,
|
||||
iconCustomEmojiId: CustomEmojiId? = null,
|
||||
style: KeyboardButtonStyle? = null
|
||||
) = add(DisabledInlineKeyboardButton(text, iconCustomEmojiId, style))
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+4
-2
@@ -5,7 +5,9 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.utils.flatMatrix
|
||||
|
||||
fun InlineKeyboardMarkup(
|
||||
vararg buttons: InlineKeyboardButton
|
||||
vararg buttons: InlineKeyboardButton,
|
||||
forceReply: Boolean? = null
|
||||
): InlineKeyboardMarkup = InlineKeyboardMarkup(
|
||||
flatMatrix { buttons.forEach { +it } }
|
||||
keyboard = flatMatrix { buttons.forEach { +it } },
|
||||
forceReply = forceReply
|
||||
)
|
||||
+6
-3
@@ -33,7 +33,8 @@ fun ReplyKeyboardBuilder.build(
|
||||
inputFieldPlaceholder: String? = null,
|
||||
selective: Boolean? = null,
|
||||
persistent: Boolean? = null,
|
||||
) = ReplyKeyboardMarkup(matrix, resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective, persistent)
|
||||
forceReply: Boolean? = null,
|
||||
) = ReplyKeyboardMarkup(matrix, resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective, persistent, forceReply)
|
||||
|
||||
/**
|
||||
* Row builder of [KeyboardButton]
|
||||
@@ -55,8 +56,9 @@ inline fun replyKeyboard(
|
||||
inputFieldPlaceholder: String? = null,
|
||||
selective: Boolean? = null,
|
||||
persistent: Boolean? = null,
|
||||
forceReply: Boolean? = null,
|
||||
block: ReplyKeyboardBuilder.() -> Unit
|
||||
) = ReplyKeyboardBuilder().apply(block).build(resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective, persistent)
|
||||
) = ReplyKeyboardBuilder().apply(block).build(resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective, persistent, forceReply)
|
||||
|
||||
/**
|
||||
* Factory-function for [ReplyKeyboardBuilder], but in difference with [replyKeyboard] this method will create single-row
|
||||
@@ -68,8 +70,9 @@ inline fun flatReplyKeyboard(
|
||||
inputFieldPlaceholder: String? = null,
|
||||
selective: Boolean? = null,
|
||||
persistent: Boolean? = null,
|
||||
forceReply: Boolean? = null,
|
||||
block: ReplyKeyboardRowBuilder.() -> Unit
|
||||
) = replyKeyboard(resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective, persistent) {
|
||||
) = replyKeyboard(resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective, persistent, forceReply) {
|
||||
row<KeyboardButton>(block)
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -10,12 +10,14 @@ fun ReplyKeyboardMarkup(
|
||||
oneTimeKeyboard: Boolean? = null,
|
||||
inputFieldPlaceholder: String? = null,
|
||||
selective: Boolean? = null,
|
||||
persistent: Boolean? = null
|
||||
persistent: Boolean? = null,
|
||||
forceReply: Boolean? = null
|
||||
): ReplyKeyboardMarkup = ReplyKeyboardMarkup(
|
||||
flatMatrix { buttons.forEach { +it } },
|
||||
resizeKeyboard,
|
||||
oneTimeKeyboard,
|
||||
inputFieldPlaceholder,
|
||||
selective,
|
||||
persistent
|
||||
persistent,
|
||||
forceReply
|
||||
)
|
||||
Reference in new issue
Block a user