-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Синхронизация Названия и Фото чата при связке
- Loading branch information
1 parent
3f057f0
commit cb89af8
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .chats import update_chat_info | ||
from .photos import get_photo_from_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from ..core import bot | ||
from .photos import get_photo_from_url | ||
|
||
|
||
async def update_chat_info(chat_id: int, title: str, preview: str): | ||
""" | ||
Обновление информации о группе. | ||
Название, Фото | ||
""" | ||
|
||
if preview: | ||
photo = await get_photo_from_url(preview) | ||
await bot.set_chat_photo(chat_id, photo) | ||
|
||
await bot.set_chat_title(chat_id, title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters