Spaces:
Runtime error
Runtime error
File size: 1,186 Bytes
78b07ad |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# K: Keyboard Buttons
from pyrogram.types import KeyboardButton, ReplyKeyboardMarkup
def gen_keyboard(collection: list, row: int = 2) -> list[list[KeyboardButton]]:
keyboard = []
for i in range(0, len(collection), row):
kyb = []
for x in collection[i : i + row]:
kyb.append(KeyboardButton(x))
keyboard.append(kyb)
return keyboard
def session_keyboard() -> ReplyKeyboardMarkup:
return ReplyKeyboardMarkup(
[
[
KeyboardButton("New π«"),
KeyboardButton("Delete β"),
],
[
KeyboardButton("List π"),
KeyboardButton("Home π "),
],
],
resize_keyboard=True,
)
def start_keyboard() -> ReplyKeyboardMarkup:
return ReplyKeyboardMarkup(
[
[
KeyboardButton("π Session"),
KeyboardButton("Force Sub β¨"),
],
[
KeyboardButton("π₯ Users"),
KeyboardButton("Others π£"),
],
],
resize_keyboard=True,
)
|