2018-04-05 21:14:22 +03:00
|
|
|
from .common import name_inner_event
|
|
|
|
from .newmessage import NewMessage
|
|
|
|
from ..tl import types
|
|
|
|
|
|
|
|
|
|
|
|
@name_inner_event
|
|
|
|
class MessageEdited(NewMessage):
|
|
|
|
"""
|
|
|
|
Event fired when a message has been edited.
|
|
|
|
"""
|
2018-07-19 02:47:32 +03:00
|
|
|
@classmethod
|
|
|
|
def build(cls, update):
|
2018-04-05 21:14:22 +03:00
|
|
|
if isinstance(update, (types.UpdateEditMessage,
|
|
|
|
types.UpdateEditChannelMessage)):
|
2018-07-19 02:47:32 +03:00
|
|
|
event = cls.Event(update.message)
|
2018-04-05 21:14:22 +03:00
|
|
|
else:
|
|
|
|
return
|
|
|
|
|
|
|
|
event._entities = update._entities
|
2018-07-11 12:22:43 +03:00
|
|
|
return event
|
2018-04-05 21:14:22 +03:00
|
|
|
|
|
|
|
class Event(NewMessage.Event):
|
|
|
|
pass # Required if we want a different name for it
|