All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.dsl.PayButtonsBuilder.kt Maven / Gradle / Ivy

package dev.inmo.tgbotapi.keyboards.lib.dsl

import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
import dev.inmo.tgbotapi.keyboards.lib.KeyboardBuilder
import dev.inmo.tgbotapi.keyboards.lib.KeyboardMenu
import dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
import dev.inmo.tgbotapi.types.LoginURL
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
import dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery
import dev.inmo.tgbotapi.utils.RowBuilder

fun  RowBuilder>.pay(
    textBuilder: suspend BC.() -> String,
) = +KeyboardBuilder.Button.Pay(
    textBuilder = textBuilder,
)


fun  RowBuilder>.pay(
    text: String,
) = pay(
    textBuilder = { text },
)


fun  RowBuilder>.pay(
    textBuilder: suspend BC.() -> String,
    initialFilter: SimpleFilter? = null,
    onPreCheckoutQueryCallback: CustomBehaviourContextAndTypeReceiver
) = +KeyboardBuilder.Button.Pay(
    textBuilder = textBuilder,
    initialFilter = initialFilter,
    onPreCheckoutQueryCallback = onPreCheckoutQueryCallback
)


fun  RowBuilder>.pay(
    text: String,
    initialFilter: SimpleFilter? = null,
    onPreCheckoutQueryCallback: CustomBehaviourContextAndTypeReceiver
) = pay(
    textBuilder = { text },
    initialFilter = initialFilter,
    onPreCheckoutQueryCallback = onPreCheckoutQueryCallback
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy