Spaces:
Paused
Paused
alan5543 commited on
Commit ·
7c74069
1
Parent(s): 45bc669
update
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from telegram.error import TelegramError
|
|
| 4 |
from dotenv import load_dotenv
|
| 5 |
|
| 6 |
# Change this import
|
| 7 |
-
from datetime import datetime,
|
| 8 |
import os
|
| 9 |
import asyncio
|
| 10 |
|
|
@@ -42,7 +42,7 @@ def health_check():
|
|
| 42 |
{
|
| 43 |
"status": "healthy",
|
| 44 |
"message": "Telegram backend is running",
|
| 45 |
-
"timestamp": datetime.now(
|
| 46 |
}
|
| 47 |
)
|
| 48 |
|
|
@@ -65,7 +65,7 @@ def send_message():
|
|
| 65 |
if '@' not in email or '.' not in email.split('@')[1]:
|
| 66 |
return jsonify({"error": "Invalid email format"}), 400
|
| 67 |
|
| 68 |
-
timestamp = datetime.now(
|
| 69 |
telegram_message = (
|
| 70 |
f"*New Message*\n"
|
| 71 |
f"_Received on: {timestamp}_\n"
|
|
|
|
| 4 |
from dotenv import load_dotenv
|
| 5 |
|
| 6 |
# Change this import
|
| 7 |
+
from datetime import datetime, timezone # instead of just datetime
|
| 8 |
import os
|
| 9 |
import asyncio
|
| 10 |
|
|
|
|
| 42 |
{
|
| 43 |
"status": "healthy",
|
| 44 |
"message": "Telegram backend is running",
|
| 45 |
+
"timestamp": datetime.now(timezone.utc).isoformat() + " UTC"
|
| 46 |
}
|
| 47 |
)
|
| 48 |
|
|
|
|
| 65 |
if '@' not in email or '.' not in email.split('@')[1]:
|
| 66 |
return jsonify({"error": "Invalid email format"}), 400
|
| 67 |
|
| 68 |
+
timestamp = datetime.now(timezone.utc).isoformat().split('.')[0] + " UTC"
|
| 69 |
telegram_message = (
|
| 70 |
f"*New Message*\n"
|
| 71 |
f"_Received on: {timestamp}_\n"
|