mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update user.py
This commit is contained in:
parent
ef4f9c5721
commit
620c12ebd3
1 changed files with 12 additions and 0 deletions
|
|
@ -86,6 +86,18 @@ class User(base.TelegramObject):
|
|||
|
||||
async def get_profile_photos(self, offset=None, limit=None):
|
||||
return await self.bot.get_user_profile_photos(self.id, offset, limit)
|
||||
|
||||
async def ban(until_date: typing.Union[base.Integer, datetime.datetime,
|
||||
datetime.timedelta, None] = None,
|
||||
revoke_messages: typing.Optional[base.Boolean] = None
|
||||
) -> base.Boolean:
|
||||
return await self.bot.ban_chat_member(self.chat.id, self.id, until_date=until_date,
|
||||
revoke_messages=revoke_messages)
|
||||
|
||||
async def unban(self, only_if_banned: Optional[base.Boolean]) -> base.Boolean:
|
||||
return await self.bot.unban_chat_member(self.chat.id,
|
||||
self.id,
|
||||
only_if_banned=only_if_banned)
|
||||
|
||||
def __hash__(self):
|
||||
return self.id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue