def change(message): if is_admin(message): db = Db(db_dir) places = db.get_places() if places: keyboard = types.InlineKeyboardMarkup() for place in places: place_button = types.InlineKeyboardButton(text=str(place[1]), callback_data=u'{"action": "change", "id": "' + str( place[0]) + '"}') keyboard.add(place_button) bot.send_message(chat_id, "Выберите место на сегодня:", reply_markup=keyboard)
def change(message): if is_admin(message): db = Db(db_dir) places = db.get_places() if places: keyboard = types.InlineKeyboardMarkup() for place in places: place_button = types.InlineKeyboardButton( text=str(place[1]), callback_data=u'{"action": "change", "id": "' + str(place[0]) + '"}') keyboard.add(place_button) bot.send_message(chat_id, "Выберите место на сегодня:", reply_markup=keyboard)
def place_list(message): db = Db(db_dir) places = db.get_places() _str = list_to_str('Список мест', places, [1]) if _str: bot.send_message(chat_id, str(_str), parse_mode='HTML')