Last active
November 11, 2024 17:26
-
-
Save lucaspg96/284c9dbe01d05d0563fde8fbb00db220 to your computer and use it in GitHub Desktop.
A python script to send messages to a telegram user. Useful to notify when long scripts are finished!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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! | |
""" | |
bot = telegram.Bot(token=token) | |
bot.sendMessage(chat_id=chat_id, text=msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@everyone
Are there any instances of sending messages using TypeScript?