Replace most raw API usage with new location

This commit is contained in:
Lonami Exo
2021-09-12 12:16:02 +02:00
parent a901d43a6d
commit d48649602b
53 changed files with 918 additions and 984 deletions

View File

@@ -1,7 +1,7 @@
"""Errors not related to the Telegram API itself"""
import struct
from ..tl import TLRequest
from .. import _tl
class ReadCancelledError(Exception):
@@ -138,7 +138,7 @@ class MultiError(Exception):
raise TypeError(
"Expected an exception object, not '%r'" % e
)
if not isinstance(req, TLRequest):
if not isinstance(req, _tl.TLRequest):
raise TypeError(
"Expected TLRequest object, not '%r'" % req
)

View File

@@ -1,13 +1,13 @@
from ..tl import functions
from .. import _tl
_NESTS_QUERY = (
functions.InvokeAfterMsgRequest,
functions.InvokeAfterMsgsRequest,
functions.InitConnectionRequest,
functions.InvokeWithLayerRequest,
functions.InvokeWithoutUpdatesRequest,
functions.InvokeWithMessagesRangeRequest,
functions.InvokeWithTakeoutRequest,
_tl.fn.InvokeAfterMsg,
_tl.fn.InvokeAfterMsgs,
_tl.fn.InitConnection,
_tl.fn.InvokeWithLayer,
_tl.fn.InvokeWithoutUpdates,
_tl.fn.InvokeWithMessagesRange,
_tl.fn.InvokeWithTakeout,
)
class RPCError(Exception):