telegranerror.py
518 Bytes
#!/usr/bin/python3
import requests
TOKENapi = "1783332062:AAHQIjnrsebVrs7LpIvivqgc5vaqUQSagUQ"
URL = """https://api.telegram.org/bot{}/sendMessage?chat_id={}&text={}"""
#import socket , time
#hostname=socket.gethostname()
#IPAddr=socket.gethostbyname(hostname)
#texto = "Name "+hostname+ " IP Address "+IPAddr
#test = True
#while test:
# time.sleep(30)
def Notificar(texto):
try:
url = URL.format(TOKENapi,"836078789",texto)
requests.get(url)
#test = False
except:
pass