Skip to main content

Telegram bot api library in python

Project description

Telezhka

Telegram api library in python

pypi

Install

pip install --upgrade Telezhka

Simple usage

from Telezhka import Telegram
api = Telegram("883304628:ONTB4H2SAMPLEtext9m0g")

for event in api.listen():
    if "message" in event and "text" in event.message:
        if event.message.text == "/hello":
            api.sendMessage(text="Hello :)", chat_id=event.message.chat.id)

Keyboard usage

from Telezhka import Keyboard

kb = Keyboard(resize_keyboard=True)
kb.add_button(text="hello")
kb.add_line({"text": "hello2"})
# Send message with keyboard
api.sendMessage(reply_markup=kb.compile(), text="Hello", chat_id=event.message.chat.id)

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

Telezhka-0.0.11.tar.gz (2.6 kB view hashes)

Uploaded Source

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