Skip to content

Instantly share code, notes, and snippets.

Avatar

directionsystems

View GitHub Profile
@directionsystems
directionsystems / bot.py
Created Oct 3, 2019 — forked from lucaspg96/bot.py
A python script to send messages to a telegram user. Useful to notify when long scripts are finished!
View bot.py
#This script is independet of lib or python version (tested on python 2.7 and 3.5)
import telegram
#token that can be generated talking with @BotFather on telegram
my_token = ''
def send(msg, chat_id, token=my_token):
"""
Send a mensage to a telegram user specified on chatId
chat_id must be a number!