mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-15 21:30:45 +00:00
Fix classes MRO and abstractmethod usage
Furthermore utils needs to access the message by reference through types.Message because it is patched and replaced.
This commit is contained in:
@@ -8,7 +8,7 @@ from ... import utils, errors
|
||||
|
||||
# TODO Figure out a way to have the code generator error on missing fields
|
||||
# Maybe parsing the init function alone if that's possible.
|
||||
class Message(abc.ABC, TLObject, ChatGetter, SenderGetter):
|
||||
class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
|
||||
"""
|
||||
This custom class aggregates both :tl:`Message` and
|
||||
:tl:`MessageService` to ease accessing their members.
|
||||
|
||||
@@ -3,7 +3,7 @@ import struct
|
||||
from datetime import datetime, date, timedelta
|
||||
|
||||
|
||||
class TLObject(abc.ABC):
|
||||
class TLObject:
|
||||
CONSTRUCTOR_ID = None
|
||||
SUBCLASS_OF_ID = None
|
||||
|
||||
@@ -141,21 +141,18 @@ class TLObject(abc.ABC):
|
||||
def stringify(self):
|
||||
return TLObject.pretty_format(self, indent=0)
|
||||
|
||||
@abc.abstractmethod
|
||||
def to_dict(self):
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
def __bytes__(self):
|
||||
raise NotImplementedError
|
||||
|
||||
@classmethod
|
||||
@abc.abstractmethod
|
||||
def from_reader(cls, reader):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class TLRequest(abc.ABC, TLObject):
|
||||
class TLRequest(TLObject):
|
||||
"""
|
||||
Represents a content-related `TLObject` (a request that can be sent).
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user