@bot.message_handler(func=lambda message: True)
def start_finite_machine(message):
if STATE_DICT[chat_id] == 'tomsk_supplies':
handle_tomsk_suplies(message)
elif STATE_DICT[chat_id] == 'novosibirsk_supplies':
handle_novosibirsk_supplies(message)
elif STATE_DICT[chat_id] == 'novosibirsk_roses':
handle_novosibirsk_roses(message)
def handle_novosibirsk_supplies(message):
user_markup = telebot.types.ReplyKeyboardMarkup(True)
user_markup.row('Цветы2')
user_markup.row('Главное меню')
chat_id = message.chat.id
STATE_DICT[chat_id] = 'novosibirsk_roses'
bot.send_message(message.from_user.id, 'Город: <b>Новосибирск</b> \n\nВыберите товар:',
reply_markup=user_markup, parse_mode='html')
sites = {
"asos" : ["adidas", "nike", "reebok", "asics", "karhu"],
"lamoda" : ["adidas", "nike", "reebok", "asics", "karhu", "demix", "fila"],
"brandshop" : ["adidas", "reebok", "champion" ],
}
def get_sites(sites, name="asics"):
for key, value in sites.items():
if name in value:
print(key +'.com')
else:
print("Такой марки нет")
get_sites(sites, name="asics")