telegram_avatar/__main__.py
async def change_avatar(
        tg_client: TelegramClient,
        avatar_generator: AvatarGenerator,
) -> None:
    """
    Function which updates Telegram avatar with generated new one.
    Args:
        tg_client: authorised telethon.TelegramClient object.
        avatar_generator: AvatarGenerator object which generates
            new avatar image.
    """
    # Deleting Telegram avatar
    await tg_client(
        DeletePhotosRequest(await tg_client.get_profile_photos('me'))
    )
    # Generating and load a new Telegram avatar
    file = await tg_client.upload_file(
        avatar_generator.generate()
    )
    # Updating Telegram avatar
    await tg_client(
        UploadProfilePhotoRequest(file)
    )
    return

    Function which updates Telegram avatar with generated new one.
    Args:
        tg_client: authorised telethon.TelegramClient object.
        avatar_generator: AvatarGenerator object which generates
            new avatar image.
    
Function which updates Telegram avatar with generated new one.
Function which updates Telegram avatar with generated new one .
async def change_avatar(
        tg_client: TelegramClient,
        avatar_generator: AvatarGenerator,
) -> None:
    await tg_client(
        DeletePhotosRequest(await tg_client.get_profile_photos('me'))
    )
    file = await tg_client.upload_file(
        avatar_generator.generate()
    )
    await tg_client(
        UploadProfilePhotoRequest(file)
    )
    return
async def change_avatar ( tg_client : TelegramClient , avatar_generator : AvatarGenerator , ) -> None : await tg_client ( DeletePhotosRequest ( await tg_client . get_profile_photos ( 'me' ) ) ) file = await tg_client . upload_file ( avatar_generator . generate ( ) ) await tg_client ( UploadProfilePhotoRequest ( file ) ) return
Function which updates Telegram avatar with generated new one.
Function which updates Telegram avatar with generated new one .
"""
    Function which updates Telegram avatar with generated new one.
    Args:
        tg_client: authorised telethon.TelegramClient object.
        avatar_generator: AvatarGenerator object which generates
            new avatar image.
    """ # Deleting Telegram avatar # Generating and load a new Telegram avatar # Updating Telegram avatar
tg_client
TelegramClient
authorised telethon.TelegramClient object.
authorised telethon . TelegramClient object .
avatar_generator
AvatarGenerator
AvatarGenerator object which generates
new avatar image.
AvatarGenerator object which generates new avatar image .