def old_address_keyboard():
keyboard = types.InlineKeyboardMarkup(row_width=3)
try:
cursor.execute("SELECT * FROM Garoyib_doktor")
Garoyib_doktor = cursor.fetchall()
for a in Garoyib_doktor:
c = a[1]
g = a[1]
keyboard.add(types.InlineKeyboardButton(text=str(c) + "-qism",callback_data="garoyib_" + str(g)))
keyboard.add(types.InlineKeyboardButton(text="❌ Назад", callback_data="checkout_back"))
return keyboard
except Exception as e:
return False
def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the result of this function: {keyboard: [["A", "B"], ["C"]]}
See https://core.telegram.org/bots/api#replykeyboardmarkup
:param args: KeyboardButton to append to the keyboard
"""
def row(self, *args):
"""
Adds a list of KeyboardButton to the keyboard. This function does not consider row_width.
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
See https://core.telegram.org/bots/api#inlinekeyboardmarkup
:param args: strings
:return: self, to allow function chaining.
"""