DmitrMakeev commited on
Commit
6667899
·
verified ·
1 Parent(s): 782e69f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -105,7 +105,7 @@ def send_message(chat_id, text):
105
  url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
106
  data = {"chat_id": chat_id, "text": text}
107
  response = requests.post(url, data=data)
108
- print(f"Ответ Telegram: {response.json()}") # Лог для проверки
109
 
110
  @app.route("/webhook", methods=["POST"])
111
  def process():
@@ -148,6 +148,9 @@ def set_webhook_page():
148
  api_url = f"https://api.telegram.org/bot{token}/setWebhook"
149
  response = requests.post(api_url, data={"url": url})
150
 
 
 
 
151
  try:
152
  result = response.json() # Попытка распарсить JSON
153
  except ValueError:
 
105
  url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
106
  data = {"chat_id": chat_id, "text": text}
107
  response = requests.post(url, data=data)
108
+ print(f"Ответ Telegram: {response.text}") # Логируем текстовый ответ для отладки
109
 
110
  @app.route("/webhook", methods=["POST"])
111
  def process():
 
148
  api_url = f"https://api.telegram.org/bot{token}/setWebhook"
149
  response = requests.post(api_url, data={"url": url})
150
 
151
+ # Логируем ответ для отладки
152
+ print(f"Ответ от Telegram: {response.text}")
153
+
154
  try:
155
  result = response.json() # Попытка распарсить JSON
156
  except ValueError: