From 7baa00353d7a9f755203a32bae1f77394bf32121 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 11 Jun 2019 15:59:39 +0200 Subject: [PATCH] Add a FAQ about DC migration --- docs/source/faq.rst | 23 ++++++++++++++++---- pyrogram/client/methods/users/get_user_dc.py | 9 ++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 6ff16559..f08da03f 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -152,11 +152,26 @@ kept as aliases. ***** Alias DC -I keep getting PEER_ID_INVALID error! -------------------------------------------- +I want to migrate my account from DCX to DCY. +--------------------------------------------- -The error in question is ``[400 PEER_ID_INVALID]``, and could mean several -things: +This question is often asked by people who find their account(s) always being connected to DC1 - USA (for example), but +are connecting from a place far away (e.g DC4 - Europe), thus resulting in slower interactions when using the API +because of the great physical distance between the user and its associated DC. + +When registering an account for the first time, is up to Telegram to decide which DC the new user is going to be created +in, based on the phone number origin. + +Even though Telegram `documentations `_ state the server might +decide to automatically migrate a user in case of prolonged usages from a distant, unusual location and albeit this +mechanism is also `confirmed `_ to exist by Telegram itself, +it's currently not possible to have your account migrated, in any way, simply because the feature was once planned but +not yet implemented. + +I keep getting PEER_ID_INVALID error! +------------------------------------- + +The error in question is ``[400 PEER_ID_INVALID]``, and could mean several things: - The chat id you tried to use is simply wrong, double check it. - The chat id refers to a group or channel you are not a member of. diff --git a/pyrogram/client/methods/users/get_user_dc.py b/pyrogram/client/methods/users/get_user_dc.py index 7cb43d83..718f4c44 100644 --- a/pyrogram/client/methods/users/get_user_dc.py +++ b/pyrogram/client/methods/users/get_user_dc.py @@ -28,9 +28,9 @@ class GetUserDC(BaseClient): .. note:: - This information is approximate: it is based on where the user stores their profile pictures and does not by - any means tell you the user location. More info at - `FAQs <../faq#what-are-the-ip-addresses-of-telegram-data-centers>`_. + This information is approximate: it is based on where Telegram stores a user profile pictures and does not + by any means tell you the user location (i.e. a user might travel far away, but will still connect to its + assigned DC). More info at `FAQs <../faq#what-are-the-ip-addresses-of-telegram-data-centers>`_. Parameters: user_id (``int`` | ``str``): @@ -39,7 +39,8 @@ class GetUserDC(BaseClient): For a contact that exists in your Telegram address book you can use his phone number (str). Returns: - ``int`` | ``None``: The DC identifier as integer, or None in case it wasn't possible to get it. + ``int`` | ``None``: The DC identifier as integer, or None in case it wasn't possible to get it (i.e. the + user has no profile picture or has the privacy setting enabled). Raises: RPCError: In case of a Telegram RPC error.