mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Move Message redefinitions back to patched
Fixes #1695. This matches the older behaviour better, although the patched module is now written manually.
This commit is contained in:
parent
23041f398b
commit
9a47fdc1ee
|
@ -11,7 +11,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(ChatGetter, SenderGetter):
|
||||
class Message(ChatGetter, SenderGetter, TLObject):
|
||||
"""
|
||||
This custom class aggregates both :tl:`Message` and
|
||||
:tl:`MessageService` to ease accessing their members.
|
||||
|
@ -1130,22 +1130,3 @@ class _Message(ChatGetter, SenderGetter):
|
|||
return None
|
||||
|
||||
# endregion Private Methods
|
||||
|
||||
|
||||
class MessageEmpty(_Message, types.MessageEmpty):
|
||||
pass
|
||||
|
||||
types.MessageEmpty = MessageEmpty
|
||||
alltlobjects.tlobjects[MessageEmpty.CONSTRUCTOR_ID] = MessageEmpty
|
||||
|
||||
class MessageService(_Message, types.MessageService):
|
||||
pass
|
||||
|
||||
types.MessageService = MessageService
|
||||
alltlobjects.tlobjects[MessageService.CONSTRUCTOR_ID] = MessageService
|
||||
|
||||
class Message(_Message, types.Message):
|
||||
pass
|
||||
|
||||
types.Message = Message
|
||||
alltlobjects.tlobjects[Message.CONSTRUCTOR_ID] = Message
|
||||
|
|
|
@ -1,2 +1,20 @@
|
|||
# Compatibility for people relying on this module
|
||||
from ..custom.message import MessageEmpty, MessageService, Message
|
||||
from .. import types, alltlobjects
|
||||
from ..custom.message import Message as _Message
|
||||
|
||||
class MessageEmpty(_Message, types.MessageEmpty):
|
||||
pass
|
||||
|
||||
types.MessageEmpty = MessageEmpty
|
||||
alltlobjects.tlobjects[MessageEmpty.CONSTRUCTOR_ID] = MessageEmpty
|
||||
|
||||
class MessageService(_Message, types.MessageService):
|
||||
pass
|
||||
|
||||
types.MessageService = MessageService
|
||||
alltlobjects.tlobjects[MessageService.CONSTRUCTOR_ID] = MessageService
|
||||
|
||||
class _Message(_Message, types.Message):
|
||||
pass
|
||||
|
||||
Message = _Message
|
||||
types.Message = Message
|
||||
|
|
Loading…
Reference in New Issue
Block a user