Spaces:
Paused
Paused
Captain Ezio
commited on
Commit
·
5ae3313
1
Parent(s):
b47a5ca
Nothing major
Browse files- Powers/utils/kbhelpers.py +18 -0
Powers/utils/kbhelpers.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def ikb(rows=None):
|
| 5 |
+
if rows is None:
|
| 6 |
+
rows = []
|
| 7 |
+
lines = []
|
| 8 |
+
for row in rows:
|
| 9 |
+
line = []
|
| 10 |
+
for button in row:
|
| 11 |
+
button = btn(*button) # InlineKeyboardButton
|
| 12 |
+
line.append(button)
|
| 13 |
+
lines.append(line)
|
| 14 |
+
return InlineKeyboardMarkup(inline_keyboard=lines)
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def btn(text, value, type="callback_data"):
|
| 18 |
+
return InlineKeyboardButton(text, **{type: value})
|