MatteoScript commited on
Commit
d86ad8c
·
verified ·
1 Parent(s): 0808f77

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -1
main.py CHANGED
@@ -33,7 +33,13 @@ def webhook(data: dict):
33
 
34
  @app.post("/TEST")
35
  def test(data: dict):
36
- requests.get("http://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/sendMessage?chat_id=1738997897&text=Come_Stai_Vez")
 
 
 
 
 
 
37
  return {"response": "TEST"}
38
 
39
 
 
33
 
34
  @app.post("/TEST")
35
  def test(data: dict):
36
+ url = "http://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/sendMessage?chat_id=1738997897&text=Come_Stai_Vez"
37
+ try:
38
+ response = requests.get(url)
39
+ response.raise_for_status() # Controlla se la richiesta ha avuto successo
40
+ print(response.json()) # Stampa la risposta JSON
41
+ except requests.exceptions.RequestException as e:
42
+ print(f"Errore nella richiesta: {e}")
43
  return {"response": "TEST"}
44
 
45