Skip to main content

Limit your api calls to avoid "Flood control exceeded"

Project description

What is it?

Limited aiogram is an add-on for the original aiogram Bot. This package allows you to limit how often your bot sends messages

Telegram api limits

Telegram has a number of restrictions for sending messages:

  • 30 messages per second to multiple users
  • 20 requests/sec to group
  • 1 message per second to individual chat

Installation

pip install limited_aiogram

Usage

The code below patches the original Bot class from aiogram, these changes are not reversible!

import limited_aiogram
limited_aiogram.patch_bot()

It is also possible to use a separate class LimitedBot, without changing the original class

import limited_aiogram
bot = limited_aiogram.LimitedBot('your token')

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

limited_aiogram-1.0.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

limited_aiogram-1.0.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file limited_aiogram-1.0.2.tar.gz.

File metadata

  • Download URL: limited_aiogram-1.0.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for limited_aiogram-1.0.2.tar.gz
Algorithm Hash digest
SHA256 8c073e1c8cdaf1b328ac4140d0eef9349875f87548c0a01028fa1ecb23e9ed92
MD5 c460197a68d4053df5deb9c41d5514e5
BLAKE2b-256 2ed88d650ac8bb65f605c9c693b2bf11c1450d3a68f9856388fbc24633781a1a

See more details on using hashes here.

File details

Details for the file limited_aiogram-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for limited_aiogram-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8958eb2509193f8077d6ae126c0796074489779929c61cd04e2e260e459a31f2
MD5 80fdc95fc8ab5e772de84890f626a4d9
BLAKE2b-256 ef7ea176c8041280720f02044581ae4a7a95b9d16348bc2029c6f46ddef33a8d

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