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.
- Join the Kerala Telegram Chat Group
- We now have a Telegram Channel as well! Keep yourself up to date with API changes, and join it.
More examples
WILL BE SOON PUBLISHED
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
keralagram-0.1.8.tar.gz
(12.1 kB
view details)
Built Distribution
File details
Details for the file keralagram-0.1.8.tar.gz
.
File metadata
- Download URL: keralagram-0.1.8.tar.gz
- Upload date:
- Size: 12.1 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f6fe8b49b3484c587fa8ab2bfd9864d1b1e1ad0ad37dc252bbda2148ffd9a10 |
|
MD5 | b5f671cb388a729de16982f757750597 |
|
BLAKE2b-256 | 6b901a6ffc196ae30cf28439151f878e0f6798417872694695192e5e50dbf72c |
File details
Details for the file keralagram-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: keralagram-0.1.8-py3-none-any.whl
- Upload date:
- Size: 19.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 738e56deae17ae6a940e70d2b3008a723ccdee1a07471ba0efd1b24916898f41 |
|
MD5 | e1ab97912bd26222e11c80a5b8320e46 |
|
BLAKE2b-256 | 0a22d6c1a814f598d5deb7c055c8b708e2d18e029d2bca9bc7c142b9208a3f80 |