File size: 486 Bytes
ca4eb6d
 
 
ffb50fb
 
 
ca4eb6d
 
 
 
 
 
 
e0f3519
ca4eb6d
 
 
 
 
ffb50fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup


def btn(text, value, type="callback_data"):
    return InlineKeyboardButton(text, **{type: value})

def ikb(rows=None):
    if rows is None:
        rows = []
    lines = []
    for row in rows:
        line = []
        for button in row:
            button = btn(*button) # InlineKeyboardButton
            line.append(button)
        lines.append(line)
    return InlineKeyboardMarkup(inline_keyboard=lines)