Raspberry-Pi/telegramtest.py
Adu Alex Göllnitz 5c42e26d41 Dateien nach "/" hochladen
Alle im Anhang ersichtlichen Dateien wurden selbst erstellt und getestet.

Sie dienen dem nutzen des Raspberry-Pi Projekts des HS25 CDS Computer-Sciences Moduls.
2025-12-17 16:53:39 +01:00

15 lines
399 B
Python

import requests
TELEGRAM_BOT_TOKEN = "8295131851:AAEGTotKaTzIvAxqxcNYk90zNOFx12vVNfk"
TELEGRAM_CHAT_ID = "8428261562"
url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
data = {
"chat_id": 8428261562,
"text": "Testnachricht vom Raspberry Pi (telegram_test.py)",
}
response = requests.post(url, json=data)
print("Status", response.status_code)
print("Antwort", response.text)