skip to Main Content

I was trying to find some documentation, but i`ve failed. I would be grateful if you send me doc or example how to do it.

2

Answers


  1. In order to change your profile photo you should use MTPROTOAPI. One of the good libraries written in Python is called telethon. You can check here on how to update profile information.

    install telethon:

    python3 -m pip install --upgrade telethon
    

    update profile photo:

    import asyncio
    from telethon import TelegramClient
    from telethon.tl.functions.photos import UploadProfilePhotoRequest
    
    
    # Use your own values from my.telegram.org
    api_id = 12345
    api_hash = '0123456789abcdef0123456789abcdef'
    
    client = await TelegramClient('anon', api_id, api_hash)
    
    await client(UploadProfilePhotoRequest(
        await client.upload_file('/path/to/some/file')
    ))
    
    Login or Signup to reply.
  2. For those who just want to change without programmatically:

    1. Send the command /setuserpic to the bot responsible for creating other @BotFather bots.
    2. Send an image to the dialog that will be set as the bot’s avatar.

    enter image description here

    Source

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search