From bfe52bb9f8c45e7789ce1bf9642280d963f1aa2d Mon Sep 17 00:00:00 2001 From: nekenny Date: Fri, 3 Apr 2026 22:46:26 +0500 Subject: [PATCH] =?UTF-8?q?feat:=20Lensa=20bot=20stub=20=E2=80=94=20Messen?= =?UTF-8?q?gerService=20interface=20ready=20for=20SDK=20integration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- backend/app/messengers/lensa/__init__.py | 0 backend/app/messengers/lensa/bot.py | 44 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 backend/app/messengers/lensa/__init__.py create mode 100644 backend/app/messengers/lensa/bot.py diff --git a/backend/app/messengers/lensa/__init__.py b/backend/app/messengers/lensa/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/messengers/lensa/bot.py b/backend/app/messengers/lensa/bot.py new file mode 100644 index 0000000..3703afb --- /dev/null +++ b/backend/app/messengers/lensa/bot.py @@ -0,0 +1,44 @@ +import logging + +from fastapi import Request, Response + +from app.messengers.base import MessengerService + +logger = logging.getLogger(__name__) + + +class LensaService(MessengerService): + """ + Stub implementation for Lensa (IVA Technologies) messenger bot. + + Lensa's Bot API/SDK is not publicly available. + This stub provides the MessengerService interface so the integration + can be implemented when SDK access is obtained from IVA Technologies. + + To integrate: + 1. Obtain SDK/API documentation from IVA Technologies (iva-tech.ru) + 2. Implement the abstract methods below + 3. Register webhook endpoint in main.py (similar to Telegram) + """ + + async def setup(self): + logger.info("Lensa bot: stub — SDK not available, skipping setup") + + async def shutdown(self): + logger.info("Lensa bot: stub — shutting down") + + async def send_message(self, chat_id: str, text: str, **kwargs): + logger.warning(f"Lensa bot: send_message not implemented (chat_id={chat_id})") + + async def send_file(self, chat_id: str, file_path: str, caption: str = ""): + logger.warning(f"Lensa bot: send_file not implemented (chat_id={chat_id})") + + async def notify_progress(self, chat_id: str, status: str, progress: int | None = None): + logger.warning(f"Lensa bot: notify_progress not implemented (chat_id={chat_id})") + + async def feed_webhook(self, request: Request) -> Response: + logger.warning("Lensa bot: webhook received but SDK not implemented") + return Response(status_code=200) + + +lensa_service = LensaService()