From d06289c88d15d9db51f55bd5b11516b96528deb7 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 20 Jun 2019 15:31:02 +0200 Subject: [PATCH 1/5] Add FAQ about why responses might be slow --- docs/source/faq.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 05fa0bb5..4c737291 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -205,6 +205,34 @@ mechanism is also `confirmed `_ for this list. + I keep getting PEER_ID_INVALID error! ------------------------------------- From a928981b1f8b3f520dc8c4d827cbce2e4e23949c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 20 Jun 2019 16:07:57 +0200 Subject: [PATCH 2/5] Link back to the source of information, where applicable --- docs/source/faq.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 4c737291..288c5502 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -185,9 +185,12 @@ IP addresses are now kept as aliases. DC2, "AMS, Amsterdam, NL", ``149.154.167.40``, ``2001:67c:4e8:f002::e`` DC3*, "MIA, Miami FL, USA", ``149.154.175.117``, ``2001:b28:f23d:f003::e`` +.. centered:: More info about the Test Environment can be found :doc:`here `. + ***** Alias DC -More info about the Test Environment can be found :doc:`here `. +Thanks to `@FrayxRulez `_ for telling about alias DCs. + I want to migrate my account from DCX to DCY. --------------------------------------------- @@ -205,6 +208,8 @@ mechanism is also `confirmed `_ for confirming the feature was not implemented yet. + Why is my client reacting slowly in supergroups? ------------------------------------------------ @@ -231,7 +236,7 @@ noticeable, especially if you are among the lower end of the priority list: 5. Recent online users. 6. Everyone else. -Thanks `@Manuel15 `_ for this list. +Thanks to `@Manuel15 `_ for the priority list. I keep getting PEER_ID_INVALID error! ------------------------------------- @@ -276,7 +281,7 @@ Having said that, here's a list of what Telegram definitely doesn't like: - Spam, sending unsolicited messages or adding people to unwanted groups and channels. - Virtual/VoIP and cheap real numbers, because they are relatively easy to get and likely used for spam/flood. -And here's a good explanation of how, probably, the system works: +And thanks to `@koteeq `_, here's a good explanation of how, probably, the system works: .. raw:: html @@ -285,8 +290,7 @@ And here's a good explanation of how, probably, the system works: data-telegram-post="PyrogramChat/69424" data-width="100%"> - -.. centered:: Join the discussion at `@Pyrogram `_ +

However, you might be right, and your account was deactivated/limited without any good reason. This could happen because of mistakes by either the automatic systems or a moderator. In such cases you can kindly email Telegram at From 83900f398f7516e0f50850037dc09178a6d1749b Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 20 Jun 2019 16:10:18 +0200 Subject: [PATCH 3/5] Specify that 3.5.3 or higher is required for asyncio --- docs/source/intro/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/intro/install.rst b/docs/source/intro/install.rst index 82ab4c0b..b60671f0 100644 --- a/docs/source/intro/install.rst +++ b/docs/source/intro/install.rst @@ -47,7 +47,7 @@ Pyrogram heavily depends on IO-bound network code (it's a cloud-based messaging where asyncio shines the most by providing extra performance and efficiency while running on a single OS-level thread only. -**A fully asynchronous variant of Pyrogram is therefore available** (Python 3.5.3+ required). +**A fully asynchronous variant of Pyrogram is therefore available** (Python 3.5.3 or higher is required). Use this command to install (note "asyncio.zip" in the link): .. code-block:: text From 11b4b947ac08ffd7d3049caaa371b055db6bc8e4 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 20 Jun 2019 16:12:14 +0200 Subject: [PATCH 4/5] Small rewords --- docs/source/faq.rst | 2 +- docs/source/topics/storage-engines.rst | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 288c5502..335f4bc6 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -255,7 +255,7 @@ UnicodeEncodeError: '' codec can't encode … Where ```` might be *ascii*, *cp932*, *charmap* or anything else other than **utf-8**. This error usually shows up when you try to print something and has very little to do with Pyrogram itself as it is strictly related to your own terminal. To fix it, either find a way to change the encoding settings of your terminal to UTF-8 or switch to a -better one. +better terminal altogether. My verification code expires immediately! ----------------------------------------- diff --git a/docs/source/topics/storage-engines.rst b/docs/source/topics/storage-engines.rst index 933a21b3..a161e50f 100644 --- a/docs/source/topics/storage-engines.rst +++ b/docs/source/topics/storage-engines.rst @@ -31,7 +31,7 @@ File Storage ^^^^^^^^^^^^ This is the most common storage engine. It is implemented by using **SQLite**, which will store the session and peers -details. The database will be saved to disk as a single portable file and is designed to efficiently save and retrieve +details. The database will be saved to disk as a single portable file and is designed to efficiently store and retrieve peers whenever they are needed. To use this type of engine, simply pass any name of your choice to the ``session_name`` parameter of the @@ -51,7 +51,7 @@ session database will be automatically loaded. Memory Storage ^^^^^^^^^^^^^^ -In case you don't want to have any session file saved on disk, you can use an in-memory storage by passing the special +In case you don't want to have any session file saved to disk, you can use an in-memory storage by passing the special session name "**:memory:**" to the ``session_name`` parameter of the :obj:`~pyrogram.Client` constructor: .. code-block:: python @@ -61,16 +61,12 @@ session name "**:memory:**" to the ``session_name`` parameter of the :obj:`~pyro with Client(":memory:") as app: print(app.get_me()) -This database is still backed by SQLite, but exists purely in memory. However, once you stop a client, the entire -database is discarded and the session details used for logging in again will be lost forever. +This storage engine is still backed by SQLite, but the database exists purely in memory. This means that, once you stop a +client, the entire database is discarded and the session details used for logging in again will be lost forever. Session Strings --------------- -Session strings are useful when you want to run authorized Pyrogram clients on platforms like -`Heroku `_, where their ephemeral filesystems makes it much harder for a file-based storage -engine to properly work as intended. - In case you want to use an in-memory storage, but also want to keep access to the session you created, call :meth:`~pyrogram.Client.export_session_string` anytime before stopping the client... @@ -81,8 +77,8 @@ In case you want to use an in-memory storage, but also want to keep access to th with Client(":memory:") as app: print(app.export_session_string()) -...and save the resulting string somewhere. You can use this string as session name the next time you want to login -using the same session; the storage used will still be completely in-memory: +...and save the resulting (quite long) string somewhere. You can use this string as session name the next time you want +to login using the same session; the storage used will still be completely in-memory: .. code-block:: python @@ -93,3 +89,11 @@ using the same session; the storage used will still be completely in-memory: with Client(session_string) as app: print(app.get_me()) +Session strings are useful when you want to run authorized Pyrogram clients on platforms like +`Heroku `_, where their ephemeral filesystems makes it much harder for a file-based storage +engine to properly work as intended. + +But, why is the session string so long? Can't it be shorter? No, it can't. The session string already packs the bare +minimum data Pyrogram needs to successfully reconnect to an authorized session, and the 2048-bits auth key is the major +contributor to the overall length. Needless to repeat that this string, as well as any other session storage, represent +strictly personal data. Keep them safe. From 0699bd31e5e75addab28d90397e9811548fcc00e Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 20 Jun 2019 19:23:33 +0200 Subject: [PATCH 5/5] Bring Message .reply() and .edit() back for now --- pyrogram/client/types/messages_and_media/message.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyrogram/client/types/messages_and_media/message.py b/pyrogram/client/types/messages_and_media/message.py index cd59b5eb..52e8f473 100644 --- a/pyrogram/client/types/messages_and_media/message.py +++ b/pyrogram/client/types/messages_and_media/message.py @@ -727,6 +727,8 @@ class Message(Object, Update): reply_markup=reply_markup ) + reply = reply_text + def reply_animation( self, animation: str, @@ -2409,6 +2411,8 @@ class Message(Object, Update): reply_markup=reply_markup ) + edit = edit_text + def edit_caption( self, caption: str,