miniproto.auth.dc.select_dc_option
miniproto.auth.dc.select_dc_option
Section titled “miniproto.auth.dc.select_dc_option”select_dc_option(options: Iterable[DCOption], dc_id: int, *, prefer_ipv6: bool = False, allow_media_only: bool = False) -> DCOptionChoose the best endpoint for a data center.
Parameters:
- options (
Iterable[DCOption]) – Candidate connection options. - dc_id (
int) – Required Telegram data-center identifier. - prefer_ipv6 (
bool) – Prefer an IPv6 candidate when one is available. - allow_media_only (
bool) – Permit endpoints reserved for media traffic.
Returns:
DCOption– A non-media endpoint when possible, otherwise the best available candidate.
Raises:
ValueError– Ifoptionshas no endpoint fordc_id.