Skip to content

Instantly share code, notes, and snippets.

@ferranb
ferranb / send_telegram_message.py
Last active November 29, 2025 23:36
Python snippet to send a Telegram message
import requests
TOKEN = "GET-FROM-@BotFather"
ID_CHAT = 123 # You have to find it lisening for a https://api.telegram.org/botTOKEN/getUpdates
message = "Hello world!"
url = f"https://api.telegram.org/bot{TOKEN}/sendMessage"
payload = {
"chat_id": ID_CHAT, # https://gist.github.com/ferranb/42542c3122fae6631f7aa27e45ad9c83#file-get_telegram_updates-py
"text": message
@ferranb
ferranb / embassaments.md
Last active April 4, 2025 17:08
Embassaments