Skip to main content

Asynchronous Python API for building Telegram bots

Project description

KeralaGram

A python telegram asynchronous bot api made using aiohttp. This lib was earlier binded with httpx. But after the initial release we found it much slower than aiohttp. So we switched to aiohttp

Getting started.

  • Installation using pip:
$ pip install keralagram
  • While the API is production-ready, it is still under development, and it has regular updates, do not forget to update it regularly by calling pip install keralagram --upgrade

Writing your first bot

Prerequisites

Get an API token via @BotFather. We will call this token TOKEN. Furthermore, you have basic knowledge of the Python programming language and more importantly the Telegram Bot API.

A simple command bot

from keralagram import KeralaGram, Dispatcher
from keralagram.types import Message

bot = KeralaGram("TOKEN")
dp = Dispatcher(bot)

# you can use a list of prefixes or a single one 
# Also if the prefixes value is none defaults to "/"
@dp.on_command("start", prefixes=["!", "/"])
async def start(c: KeralaGram, m: Message):
    await m.reply_text("hello")

if __name__ == '__main__':
    dp.run()

The Telegram Chat Group

Get help. Discuss. Chat.

More examples

WILL BE SOON PUBLISHED

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

keralagram-0.1.9.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

keralagram-0.1.9-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file keralagram-0.1.9.tar.gz.

File metadata

  • Download URL: keralagram-0.1.9.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for keralagram-0.1.9.tar.gz
Algorithm Hash digest
SHA256 bd9c436bffd21fa38ccf5b3dc5d9b9e66115f2a7fe51acce06858aeb5d0cebca
MD5 fc5bb9bff3dde3af60692e7ff59529b1
BLAKE2b-256 599e416da823e7fc650b313f3fff63529e80c807881db82aa4a31cf555adb4bc

See more details on using hashes here.

File details

Details for the file keralagram-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: keralagram-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for keralagram-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 960a7d1a2780e2154bb2d5c7d5317c2fca6f62043fa67cf728b42c51cff8aac8
MD5 97d87615686fbe32ee3ba72ad130e843
BLAKE2b-256 be8ae03250011790b384f7eaa4c7b6c2b03811fe5b97623a419e72aa72f2fb9b

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