From 4cb793300c9e7a1b2186cc891cdfcd3e61bd5a8d Mon Sep 17 00:00:00 2001 From: Artem <89ufisum@gmail.com> Date: Sat, 13 May 2023 15:35:39 +0300 Subject: [PATCH] Test-massage from a bot to user --- tg_routine/commandHelpers.py | 2 +- website/views.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tg_routine/commandHelpers.py b/tg_routine/commandHelpers.py index 5544ae4..a430f0a 100644 --- a/tg_routine/commandHelpers.py +++ b/tg_routine/commandHelpers.py @@ -98,5 +98,5 @@ def write_specific_helper(message: str, from_label: str, chat=None, chat_id=None response = f"""Message from {from_label}: {message}""" # ToDo: use labels, add english and russian translations with appropriate label to /helpers/translationHelper.py. Use get_label("text") - + print(response) return response, chat_id diff --git a/website/views.py b/website/views.py index cf134ec..03379a6 100644 --- a/website/views.py +++ b/website/views.py @@ -3,7 +3,8 @@ from django.http import JsonResponse, HttpResponse from django.views import View -from tg_routine.commandHelpers import * +from tg_routine.commandHelpers import write_specific_helper +from tg_routine.commandHelpers import all_users_balance_helper from tg_routine.main import telegram_async_handler @@ -77,7 +78,7 @@ def insert_message(request, *args, **kwargs): def test_endpoint(request, *args, **kwargs): if request.method == "GET": results = all_users_balance_helper() # ToDo: for test purposes only change here. - # response, chat_id = write_specific_helper(message, from_label, chat_id=12345) # ToDo: use if there are multiple outputs + result, chat_id = write_specific_helper("message", "from_label", chat_id=12345) # ToDo: use if there are multiple outputs print(results) return JsonResponse({"test": results}) else: