mirror of
https://github.com/LamGC/oracle-manager.git
synced 2025-04-29 14:17:33 +00:00
refactor: InlineKeyboardGroupBuilder 增加快捷方法, 用于添加返回按钮.
This commit is contained in:
parent
a67b5fa818
commit
5f245513f0
@ -219,6 +219,13 @@ class InlineKeyboardRowBuilder(private val groupBuilder: InlineKeyboardGroupBuil
|
||||
}
|
||||
}
|
||||
|
||||
fun InlineKeyboardGroupBuilder.addBackButton(callback: InlineKeyboardCallback) {
|
||||
rowButton {
|
||||
text("<<< 返回上一级")
|
||||
callbackData(callback)
|
||||
}
|
||||
}
|
||||
|
||||
val CallbackQuery.callbackData: InlineKeyboardCallback
|
||||
get() {
|
||||
val refJson = gson.fromJson(data, JsonObject::class.java)
|
||||
@ -369,7 +376,7 @@ fun Random.randomString(length: Int): String {
|
||||
|
||||
fun callbackQueryOf(
|
||||
action: String,
|
||||
checkProfileOwner: Boolean = false,
|
||||
checkProfileOwner: Boolean = true,
|
||||
block: (BaseAbilityBot, Update) -> Unit
|
||||
): Reply {
|
||||
return Reply.of(block, mutableListOf<Predicate<Update>?>().apply {
|
||||
|
Loading…
Reference in New Issue
Block a user