18 lines
398 B
Python
18 lines
398 B
Python
#!/usr/bin/env python3
|
|
import sys
|
|
import os
|
|
|
|
import requests
|
|
|
|
|
|
def send_message(bot_token: str, chat_id: str, mensaje: str) -> None:
|
|
url = f"https://api.telegram.org/bot{bot_token}/sendMessage"
|
|
payload = {"chat_id": chat_id, "text": f"{mensaje}"}
|
|
|
|
response = requests.post(url, json=payload, timeout=10)
|
|
response.raise_for_status()
|
|
print("Mensaje enviado:", response.json())
|
|
|
|
|
|
|