mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Merge pull request #43 from Olegt0rr/patch-11
Update Chat method and get_link method fix
This commit is contained in:
commit
5beaf866be
1 changed files with 19 additions and 1 deletions
|
|
@ -76,7 +76,25 @@ class Chat(base.TelegramObject):
|
|||
if self.type == ChatType.PRIVATE:
|
||||
return f"tg://user?id={self.id}"
|
||||
|
||||
return f'https://t.me/{self.username}' if self.username else await self.export_invite_link()
|
||||
if self.username:
|
||||
return f'https://t.me/{self.username}'
|
||||
|
||||
if self.invite_link:
|
||||
return self.invite_link
|
||||
|
||||
await self.update_chat()
|
||||
return self.invite_link
|
||||
|
||||
async def update_chat(self):
|
||||
"""
|
||||
User this method to update Chat data
|
||||
|
||||
:return: None
|
||||
"""
|
||||
other = await self.bot.get_chat(self.id)
|
||||
|
||||
for key, value in other:
|
||||
self[key] = value
|
||||
|
||||
async def set_photo(self, photo):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue