A simple library to send Telegram notifition when your code is completed .
Project description
Telegram Notifier - Prakhar
telegram-notifier-prakhar
is a Python package designed to send notifications via Telegram. This is particularly useful for notifying users about the completion of long-running processes in their code.
Features
- Easy to integrate with any Python script.
- Customizable message content.
- Uses Telegram Bot to send notifications.
Prerequisites
Before you can use this package, you need to set up a Telegram Bot. Follow these steps to get started:
Step 1: Create a Telegram Bot
- Open Telegram app and search for "BotFather".
- Start a chat with BotFather and send
/newbot
. - Follow the instructions to create your bot. You will receive a token for accessing your bot via HTTP API.
Step 2: Get Your Chat ID
- Start a chat with your newly created bot or add it to a group.
- Send a message to the bot or in the group.
- Visit
https://api.telegram.org/bot<YourBOTToken>/getUpdates
in your web browser. - Look for
"chat":{"id":<number>}
in the response. This number is your chat ID.
Installation
Install the package via pip:
pip install telegram-notifier-prakhar
Usage
Here is a simple example of how to use the telegram-notifier-prakhar in your Python script:
from telegram_notifier import send_telegram_message
bot_token = 'your_bot_token' # Replace with your bot token
chat_id = 'your_chat_id' # Replace with your chat id
# Send a custom message
send_telegram_message(bot_token, chat_id, "Your script has finished running.")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for telegram_notifier_prakhar-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33db1a58d89506a2aaecae8c6571f958c5180c5cdaee04b91268b15caf9a975b |
|
MD5 | fc0e25505508353a99cf6598778c92fb |
|
BLAKE2b-256 | f37c4a0d3571431a1220a677a04ab06003fe65bfcd3916769c5ef2525dd4449f |
Close
Hashes for telegram_notifier_prakhar-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25045ace0037c2a7ac44727f0808cc0c17132dcea7e28e4f0d2dea723d7e9e7c |
|
MD5 | 2c162384bf9c8611bbea3c283af84121 |
|
BLAKE2b-256 | 0024a4b07db3f14d1d9f71946052005dcddc018b450415be01740bfdf174bd79 |