From 5e3dabf30faca4c0000559ef9cf89735f1b20f30 Mon Sep 17 00:00:00 2001 From: Ali Maktabi Date: Sat, 26 Oct 2024 17:46:44 +0330 Subject: [PATCH] added logs for debugging --- telegram/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/telegram/views.py b/telegram/views.py index df8d793..048cd74 100644 --- a/telegram/views.py +++ b/telegram/views.py @@ -17,6 +17,10 @@ import telebot import requests +import logging + + +logger = logging.getLogger(__name__) def get_telegram_safe_ips(): @@ -42,6 +46,8 @@ def telebot_respond(request): # if client_ip not in telegram_ips: # raise PermissionDenied("Invalid IP address") + logger.info(request.headers) + if ( request.headers.get("X-Telegram-Bot-Api-Secret-Token") != settings.TELEGRAM_BOT_API_SECRET