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

commonMain.dsl.SwitchInlineQueryButtonsBuilder.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.queries.callback.DataCallbackQuery
import dev.inmo.tgbotapi.utils.RowBuilder

fun  RowBuilder>.switchInlineQuery(
    textBuilder: suspend BC.() -> String,
    initialInlineQueryBuilder: suspend BC.() -> String
) = +KeyboardBuilder.Button.SwitchInlineQuery(
    textBuilder = textBuilder,
    initialInlineQueryBuilder = initialInlineQueryBuilder
)


fun  RowBuilder>.switchInlineQuery(
    textBuilder: suspend BC.() -> String,
    initialInlineQueryBuilder: String,
) = switchInlineQuery(
    textBuilder = textBuilder,
    initialInlineQueryBuilder = { initialInlineQueryBuilder }
)


fun  RowBuilder>.switchInlineQuery(
    text: String,
    initialInlineQueryBuilder: suspend BC.() -> String
) = switchInlineQuery(
    textBuilder = { text },
    initialInlineQueryBuilder = initialInlineQueryBuilder
)


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


fun  RowBuilder>.switchInlineQuery(
    textBuilder: suspend BC.() -> String,
    initialInlineQueryBuilder: suspend BC.() -> String,
    initialFilter: SimpleFilter? = null,
    onBaseInlineQueryCallback: CustomBehaviourContextAndTypeReceiver
) = +KeyboardBuilder.Button.SwitchInlineQuery(
    textBuilder = textBuilder,
    initialInlineQueryBuilder = initialInlineQueryBuilder,
    initialFilter = initialFilter,
    onBaseInlineQueryCallback = onBaseInlineQueryCallback
)


fun  RowBuilder>.switchInlineQuery(
    textBuilder: suspend BC.() -> String,
    initialInlineQueryBuilder: String,
    initialFilter: SimpleFilter? = null,
    onBaseInlineQueryCallback: CustomBehaviourContextAndTypeReceiver
) = switchInlineQuery(
    textBuilder = textBuilder,
    initialInlineQueryBuilder = { initialInlineQueryBuilder },
    initialFilter = initialFilter,
    onBaseInlineQueryCallback = onBaseInlineQueryCallback
)


fun  RowBuilder>.switchInlineQuery(
    text: String,
    initialInlineQueryBuilder: suspend BC.() -> String,
    initialFilter: SimpleFilter? = null,
    onBaseInlineQueryCallback: CustomBehaviourContextAndTypeReceiver
) = switchInlineQuery(
    textBuilder = { text },
    initialInlineQueryBuilder = initialInlineQueryBuilder,
    initialFilter = initialFilter,
    onBaseInlineQueryCallback = onBaseInlineQueryCallback
)


fun  RowBuilder>.switchInlineQuery(
    text: String,
    switchInlineQuery: String,
    initialFilter: SimpleFilter? = null,
    onBaseInlineQueryCallback: CustomBehaviourContextAndTypeReceiver
) = switchInlineQuery(
    { text },
    { switchInlineQuery },
    initialFilter = initialFilter,
    onBaseInlineQueryCallback = onBaseInlineQueryCallback
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy