ref: рефакторинг usecases
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user