This Python module is designed to simplify user management in Telegram bots, providing the necessary functionality for tasks such as user authentication, authorization and compliance with speed limits, ensuring effective management of user attributes and access rights.
MIT License
1
stars
0
forks
source link
Error when call `rl_controller.determine_rate_limit()` #38
[07/Feb/2024 11:16:11] INFO [logger.logger.counters_watching:494] [class.RateLimiter] Counters updated for user ID 174335103: {'per_hour': 0, 'per_day': 0, 'first_request_time': '2024-02-07 11:16:11.295304'}
Traceback (most recent call last):
File "/home/pyinstabot-downloader/app/src/bot.py", line 521, in <module>
main()
File "/home/pyinstabot-downloader/app/src/bot.py", line 517, in main
telegram.launch_bot()
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telegram/telegram.py", line 157, in launch_bot
self.telegram_bot.polling(
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/__init__.py", line 1104, in polling
self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout,
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/__init__.py", line 1179, in __threaded_polling
raise e
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/__init__.py", line 1141, in __threaded_polling
self.worker_pool.raise_exceptions()
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/util.py", line 149, in raise_exceptions
raise self.exception_info
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/util.py", line 92, in run
task(*args, **kwargs)
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/__init__.py", line 7860, in _run_middlewares_and_handler
result = handler['function'](message)
File "/home/pyinstabot-downloader/app/src/bot.py", line 115, in bot_callback_query_handler
button_post(
File "/home/pyinstabot-downloader/app/src/bot.py", line 161, in button_post
user = users_rl.user_access_check(call.message.chat.id, constants.ROLES_MAP['Post'])
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/users/users.py", line 261, in user_access_check
user_info['rate_limits'] = rl_controller.determine_rate_limit()
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/users/ratelimits.py", line 217, in determine_rate_limit
self.requests_configuration['requests_per_day'] <= self.requests_counters['requests_per_day'] or
TypeError: string indices must be integers