Skip to content

Conversation

@nekoalice42
Copy link

Warning

This is still WIP and doesn't fully work in the current state.

Tasks

  • Put new api.tl

  • Fix keywords from schema generate invalid Python code

    The below TL definition has from:flags.0?Peer which generates a initializer StoryFwdHeader.__init__() with from: Optional[Peer] parameter, which is invalid name in Python.

    storyFwdHeader#b826e150 flags:# modified:flags.3?true from:flags.0?Peer from_name:flags.1?string story_id:flags.2?int = StoryFwdHeader;
    [...]
      File "/home/nekoalice42/Projects/vendor/Telethon/client/src/telethon/_impl/tl/types/_nons.py", line 23223
        def __init__(_s, *, modified: bool, from: Optional[abcs.Peer], from_name: Optional[str], story_id: Optional[int]) -> None:
                                            ^^^^
    SyntaxError: invalid syntax
    • Introduce a function which check whether the name is a keyword, and appends an underscore (_) to the name if it is, as recommended by PEP-8.
    • Add respective tests
  • Adjust public API to represent introduced changes

    • _impl/client/client/auth.py
      • request_login_code
    • _impl/client/client/dialogs.py
      • edit_draft
    • _impl/client/client/files.py
      • send_file
      • do_send_file
    • _impl/client/client/messages.py
      • send_message
      • edit_message
      • forward_messages
      • SearchList._fetch_next
      • GlobalSearchList._fetch_next
      • unpin_message
    • _impl/client/client/users.py
      • resolve_username
    • _impl/client/types/admin_right.py
      • AdminRight._set_to_raw
    • _impl/client/types/album_builder.py
      • AlbumBuilder.add_photo
      • AlbumBuilder.add_video
      • AlbumBuilder.send
    • _impl/client/types/draft.py
      • Draft.send
    • _impl/client/types/file.py
      • File._try_from_raw_document
    • _impl/client/types/inline_result.py
      • InlineResult.send
    • _impl/client/types/peer/user.py
      • User._from_raw
    • _impl/session/message_box/adaptor.py
      • update_short_message
      • update_short_chat_message

@nekoalice42 nekoalice42 changed the title Update to layer 216 [v2] Update to layer 216 Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant