-
Notifications
You must be signed in to change notification settings - Fork 3
/
keyboards.py
28 lines (21 loc) · 1019 Bytes
/
keyboards.py
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
from telegram import InlineKeyboardButton, KeyboardButton
# this keyboard is not used at the moment
# main_board = [[InlineKeyboardButton("Prognoze", callback_data='prognosis')],
# [InlineKeyboardButton("Ajutor", callback_data='help'),
# InlineKeyboardButton("Feedback", callback_data='feedback'),
# InlineKeyboardButton("Despre noi", callback_data='about')],
# ]
default_board = [
[KeyboardButton("/prognosis")],
[KeyboardButton("/help"), KeyboardButton("/about"), KeyboardButton("/feedback")],
]
def build_route_menu(routes):
"""This constructs a list of buttons to be used in the `routes_board`
virtual keyboard, which is in turn used in the on-screen keyboard
for selecting routes.
:param routes: list of strings, corresponding to route names
:returns: list corresponding to a keyboard widget"""
row = []
for route in routes:
row.append(InlineKeyboardButton(str(route), callback_data=str(route)))
return [row]