Skip to content

Instantly share code, notes, and snippets.

{
"last_updated": "2019-03-20T17:00:25.902Z",
"scores":[
{
"score": 100000000,
"alias": "LightningPowerUsers",
"public_key": "0331f80652fb840239df8dc99205792bba2e559a05469915804c08420230e23c7c"
},
{
"score": 100000000,
@dlaptev
dlaptev / push_notifications_to_telegram.md
Last active April 17, 2024 12:23
Programmatically send push notifications to telegram from python
  1. Create a new Telegram bot:
    1. start a chat with BotFather;
    2. type /newbot, select a name (to be shown in chats) and handle for your bot;
    3. note the bot token to access HTTP API - a long string with a colon in the middle (later referred to as <token>);
    4. optionally /setdescription and /setuserpic.
  2. Add the bot to the chat/channel and note its id:
    1. add the bot to a new or existing chat or group - this is where your bot will send notifications to;
    2. go to https://api.telegram.org/bot<token>/getUpdates (replace <token> with your token);
    3. within the chat part, find and note the id field - a positive or negative number (later referred to as <chat_id>).
  3. Programmatically send notifications: