diff --git a/apps/tgbot/tgbot/handlers/base.py b/apps/tgbot/tgbot/handlers/base.py index 551b26b..d62037d 100644 --- a/apps/tgbot/tgbot/handlers/base.py +++ b/apps/tgbot/tgbot/handlers/base.py @@ -96,6 +96,7 @@ class CheckerBaseHandler(SimpleCommandHandler): te = time() logger.info(f"func {__name__} took {te - ts} sec") + # TODO: Validation classes async def validate_target(self, target: str): if validate_local(target): raise LocalhostForbidden() diff --git a/apps/tgbot/tgbot/handlers/default/ipcalc.py b/apps/tgbot/tgbot/handlers/default/ipcalc.py index e6cee69..8b02503 100644 --- a/apps/tgbot/tgbot/handlers/default/ipcalc.py +++ b/apps/tgbot/tgbot/handlers/default/ipcalc.py @@ -3,6 +3,7 @@ from typing import Union import ipaddress from tgbot.handlers.base import SimpleCommandHandler, NotEnoughArgs +from tgbot.middlewares.throttling import rate_limit ipcalc_help_message = """ ❓ Калькулятор IP подсетей. @@ -20,6 +21,7 @@ class IPCalcCommandHandler(SimpleCommandHandler): def __init__(self): super().__init__() + @rate_limit async def handler(self, message: Message): try: args = await self.process_args(message.text)