Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Modern and powerful asynchronous telegram bot framework.

Project description

Rocketgram

Modern and powerful asynchronous telegram bot framework.

How to install

For development

pip install rocketgram[aiohttp]

For production

pip install rocketgram[aiohttp,ujson,uvloop]

Dependencies

All dependencies are optional but you should install one of aiohttp and tornado to use framework.

ujson is highly recommended to speedup json parsing.

Also you can use uvloop as alternative to standard event loop.

  • Python >= 3.7
  • aiohttp >= 3.5.4
  • ujson >= 1.35
  • tornado >= 6.0.2
  • uvloop >= 0.12.1

Example

There is a trivial example below. Here is useful bot template.

from rocketgram import Bot, Dispatcher, UpdatesExecutor
from rocketgram import context, commonfilters
from rocketgram import SendMessage

token = 'YOUR_BOT_TOKEN'

router = Dispatcher()
bot = Bot(token, router=router)

@router.handler
@commonfilters.command('/start')
async def start_command():
    await SendMessage(context.user().user_id, 'Hello there!').send()

@router.handler
@commonfilters.command('/help')
async def start_command():
    await SendMessage(context.user().user_id, 'Some userful help!').send()

UpdatesExecutor.run(bot)

Release history Release notifications

This version
History Node

1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
rocketgram-1.0-py3-none-any.whl (50.9 kB) Copy SHA256 hash SHA256 Wheel py3
rocketgram-1.0.tar.gz (32.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page