From 2e05c81a5c3727143d3c3190d673c32fe713523e Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 8 Jun 2019 11:33:52 +0200 Subject: [PATCH] Update docs about Telegram data centers --- docs/source/faq.rst | 23 ++++++++++++++------ pyrogram/client/methods/users/get_user_dc.py | 6 +++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 1800a032..6ff16559 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -134,14 +134,23 @@ in a bunch of seconds: import logging logging.basicConfig(level=logging.INFO) -Another way to confirm you aren't able to connect to Telegram is by pinging these IP addresses and see whether ping -fails or not: +Another way to confirm you aren't able to connect to Telegram is by pinging the IP addresses below and see whether ping +fails or not. -- DC1: ``149.154.175.50`` -- DC2: ``149.154.167.51`` -- DC3: ``149.154.175.100`` -- DC4: ``149.154.167.91`` -- DC5: ``91.108.56.149`` +What are the IP addresses of Telegram Data Centers? +--------------------------------------------------- + +Telegram is currently composed by a decentralized, multi-DC infrastructure (each of which can work independently) spread +in 5 different locations. However, two of the less busy DCs have been lately dismissed and their IP addresses are now +kept as aliases. + +- **DC1** - MIA, Miami FL, USA: ``149.154.175.50`` +- **DC2** - AMS, Amsterdam, NL: ``149.154.167.51`` +- **DC3*** - MIA, Miami FL, USA: ``149.154.175.100`` +- **DC4*** - AMS, Amsterdam, NL: ``149.154.167.91`` +- **DC5** - SIN, Singapore, SG: ``91.108.56.149`` + +***** Alias DC I keep getting PEER_ID_INVALID error! ------------------------------------------- diff --git a/pyrogram/client/methods/users/get_user_dc.py b/pyrogram/client/methods/users/get_user_dc.py index 89e97526..7cb43d83 100644 --- a/pyrogram/client/methods/users/get_user_dc.py +++ b/pyrogram/client/methods/users/get_user_dc.py @@ -26,6 +26,12 @@ class GetUserDC(BaseClient): def get_user_dc(self, user_id: Union[int, str]) -> Union[int, None]: """Get the assigned data center (DC) of a user. + .. 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>`_. + Parameters: user_id (``int`` | ``str``): Unique identifier (int) or username (str) of the target chat.