This is my first module
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
Main Features
The following restrictions are currently implemented:
- Limit 30 requests per second for all users
- 1 message/sec to individual chats
Usage
The code below patches the original Bot class from aiogram, these changes are not reversible!
import limit_aiogram
limit_aiogram.path_bot()
It is also possible to use a separate class `LimitedBot``, without changing the original class
import limit_aiogram
bot = limit_aiogram.LimitedBot('your token')
Work in progress
A restriction for sending messages to groups will be added soon
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
limited_aiogram-0.1.1.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for limited_aiogram-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f44df3ff87b5fa2902a50df6d41c997d3dd79bb864fd9095a4f97fd525a565 |
|
MD5 | cf6ff5352abeee111d6e655a5525460f |
|
BLAKE2b-256 | c26146cc81fdb4fdf76feb9d017967720271906f0fa0170c06c834a793350d94 |