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

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

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

import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.keyboards.lib.KeyboardBuilder
import dev.inmo.tgbotapi.keyboards.lib.KeyboardMenu
import dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery

inline fun  buildMenu(menuBuilder: KeyboardBuilder.() -> Unit): KeyboardMenu {
    return KeyboardBuilder().apply(menuBuilder).buildFreezed()
}

fun  KeyboardBuilder.Button.Data.Reaction.Companion.Keyboard(
    menuBuilder: KeyboardBuilder.(DataCallbackQuery?) -> Unit
): KeyboardBuilder.Button.Data.Reaction.Keyboard = KeyboardBuilder.Button.Data.Reaction.Keyboard {
    buildMenu {
        menuBuilder(it)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy