Change the way iter_participants filters are specified

This commit is contained in:
Lonami Exo
2021-09-18 14:16:19 +02:00
parent 8114fb6c9b
commit bf61dd32af
5 changed files with 80 additions and 27 deletions

View File

@@ -240,6 +240,25 @@ The following ``utils`` methods no longer exist or have been made private:
// TODO provide the new clean utils
Changes on how to configure filters for certain client methods
--------------------------------------------------------------
Before, ``client.iter_participants`` (and ``get_participants``) would expect a type or instance
of the raw Telegram definition as a ``filter``. Now, this ``filter`` expects a string.
The supported values are:
* ``'admin'``
* ``'bot'``
* ``'kicked'``
* ``'banned'``
* ``'contact'``
If you prefer to avoid hardcoding strings, you may use ``telethon.enums.Participant``.
// TODO maintain support for the old way of doing it?
// TODO now that there's a custom filter, filter client-side for small chats?
The custom.Message class and the way it is used has changed
-----------------------------------------------------------
@@ -345,12 +364,14 @@ actually using. Now it returns an ``int`` value indicating the number of message
and were deleted.
The aggressive parameter hack has been removed
----------------------------------------------
Changes to the methods to retrieve participants
-----------------------------------------------
The "aggressive" hack in ``get_participants`` (and ``iter_participants``) is now gone.
It was not reliable, and was a cause of flood wait errors.
The ``search`` parameter is no longer ignored when ``filter`` is specified.
The total value when getting participants has changed
-----------------------------------------------------