Skip to main content

Telegram Bot Notifier

Project description

Telegram-Notify

GitHub issues Discord PyPI PyPI - Downloads

GitHub Workflow Status GitHub Workflow Status

Logo

Table of Contents

About the package

Telegram Bot to push notifications during an event trigger.

Built With

Install the package

Run the following terminal commands to install the package on the given distros.

  • Termux :
pkg install python3 
pip3 install notifly
  • Ubuntu/Debian
sudo apt install python3-pip
pip3 install notifly
  • Arch
sudo pacman -S python3-pip
pip3 install notifly

This may take a while depending on the network speed.

Prerequisites

  • Python3
    It is preinstalled in Ubuntu 20.04. To check the version use command :
python3 --version

If it is not preinstalled for some reason, proceed here and download as per requirement.

Run the following command in terminal to download the required packags for running the tool locally :

  • Using requirements file :
pip3 install -r requirements.txt
  • Directly download :
pip3 install requests==2.20.0

Working of the tool

To see how the tool works, create a telegram bot.

  1. Creating the telegram bot
    1. Open Telegram messenger, sign in to your account or create a new one.
    2. Enter @Botfather in the search tab and choose this bot.
      Note, official Telegram bots have a blue checkmark beside their name.
      image1
    3. Click Start to activate BotFather bot.
      image2
    4. Choose or type /newbot and send it.
      image3
    5. Choose a name for the bot, the bot can be found by its username in searches. The username must be unique and end with the word bot.
  2. Getting the bot API token
    • Newly created bot
      image4
    • Already existing bot
      image5 image6 image7
  3. Run sample code
from telegram import notifly

token = input("Enter bot token : ")
bot=notifly.BotHandler(token)
text = input("Enter text message : ")
print(bot.send_message(text))
opt_image = input("Do you want to send image ?")
if(opt_image=='y' or opt_image=='Y'):
    img_path = input("Enter full image path : ")
    bot.send_image(img_path)

image8 image9

Contributing

  1. Fork the Project
  2. Create your Feature Branch
git checkout -b feature/mybranch
  1. Commit your Changes
git commit -m 'Add something'
  1. Push to the Branch
git push origin feature/mybranch
  1. Open a Pull Request

Follow the given commands or use the amazing GitHub GUI
Happy Contributing :smiley:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notifly-1.1.4.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

notifly-1.1.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file notifly-1.1.4.tar.gz.

File metadata

  • Download URL: notifly-1.1.4.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for notifly-1.1.4.tar.gz
Algorithm Hash digest
SHA256 b60f0a75e6db39cfb8bb5c66607e6492f41dfd8ebbde4168a845ad58b6b310b8
MD5 fbf0b00f7acdebe70c9d12c26b6dd80a
BLAKE2b-256 319522e9b18f75c53167436f4a285d8fcca57a0b322615c4c4f44e5951d15c4d

See more details on using hashes here.

File details

Details for the file notifly-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: notifly-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for notifly-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4660fb5f1e6dcbd8c028954eb73ede1009c19342cb3a1d632667a73cbf6466cc
MD5 fd404a7f8c2d89dce524568e95a1e204
BLAKE2b-256 a192e59608473a8767674a886b76653b04e2dfe75a7edcb4d3acc8cafdf3e093

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page