Captain Ezio commited on
Commit
72ed22a
·
1 Parent(s): 135c7b6

Nothing major

Browse files
Files changed (1) hide show
  1. 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})