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)
}
}