ref: рефакторинг usecases

This commit is contained in:
Artem Tsyrulnikov
2025-12-11 18:02:46 +03:00
parent 38f1b3feba
commit 1f80d9bdfb
47 changed files with 853 additions and 3454 deletions

View File

@@ -1,5 +1,4 @@
import logging
from typing import Any
from aiogram.types import BotCommand, InlineKeyboardButton, InlineKeyboardMarkup
@@ -16,10 +15,6 @@ class TelegramBot(TelegramBase):
keyboard = InlineKeyboardMarkup(inline_keyboard=[[InlineKeyboardButton(text=button_text, url=button_url)]])
await self.bot.send_message(chat_id=chat_id, text=text, reply_markup=keyboard)
async def get_chat_member(self, chat_id: int, user_id: int) -> dict[str, Any]:
member = await self.bot.get_chat_member(chat_id=chat_id, user_id=user_id)
return member.model_dump()
async def create_chat_invite_link(self, chat_id: int, requires_approval: bool = False) -> str:
invite_link = await self.bot.create_chat_invite_link(chat_id=chat_id, creates_join_request=requires_approval)
return invite_link.invite_link