|
|
|
@ -6,7 +6,7 @@ from restoran_max_bot.common import *
|
|
|
|
from restoran_max_bot.iiko_api import customer_info, customer_create, customer_wallet
|
|
|
|
from restoran_max_bot.iiko_api import customer_info, customer_create, customer_wallet
|
|
|
|
from restoran_max_bot.rkiper_api import rkiper_customer_info, rkiper_customer_create
|
|
|
|
from restoran_max_bot.rkiper_api import rkiper_customer_info, rkiper_customer_create
|
|
|
|
from restoran_max_bot.settings import STATICFILES_DIRS
|
|
|
|
from restoran_max_bot.settings import STATICFILES_DIRS
|
|
|
|
from restoran_max_bot.utils import has_key
|
|
|
|
from restoran_max_bot.utils import has_key, is_json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# получение информации по интеграции с терминалом ikko, rkeeper
|
|
|
|
# получение информации по интеграции с терминалом ikko, rkeeper
|
|
|
|
@ -119,23 +119,33 @@ def bot_message(client: Client, message: dict, settings: dict, message_type):
|
|
|
|
chat_id=chat_id, max_token=settings['token'])
|
|
|
|
chat_id=chat_id, max_token=settings['token'])
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# для более сложных функций
|
|
|
|
|
|
|
|
if is_json(dt.title):
|
|
|
|
|
|
|
|
data = json.loads(dt.title)
|
|
|
|
|
|
|
|
if 'type' in dt.title:
|
|
|
|
|
|
|
|
if data['type'] == 'linkbutton':
|
|
|
|
|
|
|
|
maxbot_send_link_button(text=dt.descr, title_button=data['button'], link=dt.url, chat_id=chat_id,
|
|
|
|
|
|
|
|
max_token=settings['token'])
|
|
|
|
|
|
|
|
|
|
|
|
if dt.img:
|
|
|
|
if dt.img:
|
|
|
|
url = f"https://cdn.telefon-ip.ru/{dt.img}?thumb=600"
|
|
|
|
url = f"https://cdn.telefon-ip.ru/{dt.img}?thumb=600"
|
|
|
|
maxbot_send_img_message(chat_id=chat_id, max_token=settings['token'], img=url, message=dt.descr)
|
|
|
|
maxbot_send_img_message(chat_id=chat_id, max_token=settings['token'], img=url, message=dt.descr)
|
|
|
|
|
|
|
|
|
|
|
|
if '##' not in dt.title and not dt.img:
|
|
|
|
if '##' not in dt.title and not dt.img and not is_json(dt.title):
|
|
|
|
maxbot_send_text_message(chat_id=chat_id, max_token=settings['token'], message=dt.descr)
|
|
|
|
maxbot_send_text_message(chat_id=chat_id, max_token=settings['token'], message=dt.descr)
|
|
|
|
|
|
|
|
|
|
|
|
if dt.url:
|
|
|
|
if dt.url and not is_json(dt.title):
|
|
|
|
maxbot_send_text_message(chat_id=chat_id, max_token=settings['token'], message=dt.url)
|
|
|
|
maxbot_send_text_message(chat_id=chat_id, max_token=settings['token'], message=dt.url)
|
|
|
|
|
|
|
|
|
|
|
|
# отправка меню
|
|
|
|
# отправка меню
|
|
|
|
maxbot_send_menu_button(chat_id=chat_id, max_token=settings['token'], message='👇 Выберите раздел', client=client)
|
|
|
|
maxbot_send_menu_button(chat_id=chat_id, max_token=settings['token'], message='👇 Выберите раздел',
|
|
|
|
|
|
|
|
client=client)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if payload['payload_type'] == 'booking_count_people':
|
|
|
|
if payload['payload_type'] == 'booking_count_people':
|
|
|
|
print('запрос даты')
|
|
|
|
print('запрос даты')
|
|
|
|
|
|
|
|
|
|
|
|
# отправка меню
|
|
|
|
# отправка меню
|
|
|
|
maxbot_send_menu_button(chat_id=chat_id, max_token=settings['token'], message='👇 Выберите раздел', client=client)
|
|
|
|
maxbot_send_menu_button(chat_id=chat_id, max_token=settings['token'], message='👇 Выберите раздел',
|
|
|
|
|
|
|
|
client=client)
|
|
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|