Skip to main content

A python package to send notifications via telegram

Project description

Pytifications

This is a python package to send messages to your telegram from python code

Installation

We are on PyPi! just paste this code on terminal

pip install pytifications

And you're done

Usage

First you'll need to create an account at the pytificator bot

After that just import the library like so

from pytifications import Pytifications


#use your credentials created at the bot
Pytifications.login("myUsername","myPassword")

#and send!
Pytifications.send_message("hello from python!")

Extra features

  • Callbacks
#every message can be sent with buttons attached so you can be responsive with your messages

from pytifications import Pytifications,PytificationButton

#login and etc...

def my_callback_func():
    print('called!')

Pytifications.send_message('hi!',buttons=[
    #each column is an inner list
    [
        #use the PytificationButton
        PytificationButton(
            text="I'm a button!",
            callback=my_callback_func
        )
    ]
])
  • Edit last message
from pytifications import Pytifications

#login and etc...

Pytifications.send_message("hi, i'm not edited!")

#simply edit the last message
Pytifications.edit_last_message("now i am!")

#you can also change the buttons on the message!

def do_something():
    print('something done!')

Pytifications.edit_last_message("now with buttons!",buttons=[
    [
        PytificationButton(
            text="do something...",
            callback=do_something
        )
    ]
])

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

pytifications-0.0.7.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

pytifications-0.0.7-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

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