diff --git a/readthedocs/extra/changelog.rst b/readthedocs/extra/changelog.rst index aef9865b..1117ec4b 100644 --- a/readthedocs/extra/changelog.rst +++ b/readthedocs/extra/changelog.rst @@ -14,8 +14,92 @@ it can take advantage of new goodies! .. contents:: List of All Versions -Better Custom Message(v1.1.1) -============================= +Conversations, String Sessions and More (v1.2) +============================================== + +*Published at 2018/08/14* + + +This is a big release! Quite a few things have been added to the library, +such as the new `Conversation `. +This makes it trivial to get tokens from `@BotFather `_: + +.. code-block:: python + + from telethon.tl import types + + with client.conversation('BotFather') as conv: + conv.send_message('/mybots') + message = conv.get_response() + message.click(0) + message = conv.get_edit() + message.click(0) + message = conv.get_edit() + for _, token in message.get_entities_text(types.MessageEntityCode): + print(token) + + +In addition to that, you can now easily load and export session files +without creating any on-disk file thanks to the ``StringSession``: + +.. code-block:: python + + from telethon.sessions import StringSession + string = StringSession.save(client.session) + +Check out :ref:`sessions` for more details. + +For those who aren't able to install ``cryptg``, the support for ``libssl`` +has been added back. While interfacing ``libssl`` is not as fast, the speed +when downloading and sending files should really be noticeably faster. + +While those are the biggest things, there are still more things to be +excited about. + + +Additions +~~~~~~~~~ + +- The mentioned method to start a new `client.conversation + `. +- Implemented global search through `client.iter_messages + ` + with ``None`` entity. +- New `client.inline_query ` + method to perform inline queries. +- Bot-API-style ``file_id`` can now be used to send files and download media. + You can also access `telethon.utils.resolve_bot_file_id` and + `telethon.utils.pack_bot_file_id` to resolve and create these + file IDs yourself. Note that each user has its own ID for each file + so you can't use a bot's ``file_id`` with your user, except stickers. +- New `telethon.utils.get_peer`, useful when you expect a :tl:`Peer`. + +Bug fixes +~~~~~~~~~ + +- UTC timezone for `telethon.events.userupdate.UserUpdate`. +- Bug with certain input parameters when iterating messages. +- RPC errors without parent requests caused a crash, and better logging. +- ``incoming = outgoing = True`` was not working properly. +- Getting a message's ID was not working. +- File attributes not being inferred for ``open()``'ed files. +- Use ``MemorySession`` if ``sqlite3`` is not installed by default. +- Self-user would not be saved to the session file after signing in. +- `client.catch_up() ` + seems to be functional again. + + +Enhancements +~~~~~~~~~~~~ + +- Updated documentation. +- Invite links will now use cache, so using them as entities is cheaper. +- You can reuse message buttons to send new messages with those buttons. +- ``.to_dict()`` will now work even on invalid ``TLObject``'s. + + +Better Custom Message (v1.1.1) +============================== *Published at 2018/07/23* diff --git a/readthedocs/extra/examples/projects-using-telethon.rst b/readthedocs/extra/examples/projects-using-telethon.rst index 3c92e660..bbeff910 100644 --- a/readthedocs/extra/examples/projects-using-telethon.rst +++ b/readthedocs/extra/examples/projects-using-telethon.rst @@ -14,6 +14,17 @@ the library. .. _projects-telegram-export: +telethon_examples/ +****************** + +`Link `_ / +`Author's website `_ + +This documentation is not the only place where you can find useful code +snippets using the library. The main repository also has a folder with +some cool examples (even a Tkinter GUI!) which you can download, edit +and run to learn and play with them. + telegram-export *************** diff --git a/readthedocs/extra/examples/users.rst b/readthedocs/extra/examples/users.rst index e029596e..85f5ca65 100644 --- a/readthedocs/extra/examples/users.rst +++ b/readthedocs/extra/examples/users.rst @@ -39,8 +39,8 @@ request. Omitted fields won't change after invoking :tl:`UpdateProfile`: from telethon.tl.functions.account import UpdateProfileRequest - client(UpdateProfileRequest(a - bout='This is a test from Telethon' + client(UpdateProfileRequest( + about='This is a test from Telethon' )) diff --git a/telethon/client/updates.py b/telethon/client/updates.py index dcd85fc9..a4cd868e 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -127,6 +127,13 @@ class UpdateMethods(UserMethods): return [(callback, event) for event, callback in self._event_builders] async def catch_up(self): + """ + "Catches up" on the missed updates while the client was offline. + You should call this method after registering the event handlers + so that the updates it loads can by processed by your script. + + This can also be used to forcibly fetch new updates if there are any. + """ state = self.session.get_update_state(0) if not state or not state.pts: state = await self(functions.updates.GetStateRequest()) diff --git a/telethon/version.py b/telethon/version.py index bf03cd53..7b141296 100644 --- a/telethon/version.py +++ b/telethon/version.py @@ -1,3 +1,3 @@ # Versions should comply with PEP440. # This line is parsed in setup.py: -__version__ = '1.1.1' +__version__ = '1.2'