managementbot / Powers /utils /kbhelpers.py
iamgojoof6eyes
Looks good
15e685f
raw
history blame
460 Bytes
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
def ikb(rows=None):
if rows is None:
rows = []
lines = []
for row in rows:
line = []
for button in row:
button = btn(*button)
line.append(button)
lines.append(line)
return InlineKeyboardMarkup(inline_keyboard=lines)
def btn(text, value, type="callback_data"):
return InlineKeyboardButton(text, **{type: value})