skip to Main Content

In the new Telegram update, it is possible for premium users to install emoji status. Is it possible to implement this through Telethon?

2

Answers


  1. This will be possible once v1.26 is released (which isn’t at the time of writing) once this PR is merged. If you install the development version with these changes, or your Telethon version is v1.26 or higher, you can use telethon.tl.functions.account.UpdateEmojiStatusRequest to change your status. It will require a telethon.tl.types.EmojiStatus instance, which itself requires the document_id of the emoji you want.

    Login or Signup to reply.
  2. I believe it’d be actually like that:

    from telethon.sync import TelegramClient
    from telethon import functions, types
    
    with TelegramClient(name, api_id, api_hash) as client:
        result = client(functions.account.UpdateEmojiStatusRequest(
            emoji_status=types.EmojiStatus(
                document_id=-12398745604826
            )
        ))
        print(result)
    

    because UpdateEmojiStatusRequest expects a types.EmojiStatus, not s string – according to https://github.com/telegramdesktop/tdesktop/blob/2a6e2fa353d5c4b7ab6a05eef5ce8952c78c2a73/Telegram/Resources/tl/api.tl#L1557

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