From f9ca0932893b83a7163d7d892504da0b29d20146 Mon Sep 17 00:00:00 2001 From: Serj Berbeha Date: Mon, 22 Apr 2024 20:43:10 +0300 Subject: [PATCH] Add SenderGetter to EventCommon Integrating the `SenderGetter` functionality into the `EventCommon` class, allowing access to sender properties and methods in addition to the existing chat properties and methods. --- telethon/events/common.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/telethon/events/common.py b/telethon/events/common.py index e295adb2..f29cb532 100644 --- a/telethon/events/common.py +++ b/telethon/events/common.py @@ -5,6 +5,7 @@ import warnings from .. import utils from ..tl import TLObject, types from ..tl.custom.chatgetter import ChatGetter +from ..tl.custom.sendergetter import SenderGetter async def _into_id_set(client, chats): @@ -127,13 +128,14 @@ class EventBuilder(abc.ABC): return self.func(event) -class EventCommon(ChatGetter, abc.ABC): +class EventCommon(SenderGetter, ChatGetter, abc.ABC): """ Intermediate class with common things to all events. Remember that this class implements `ChatGetter - ` which - means you have access to all chat properties and methods. + ` and `SenderGetter + ` which means you + have access to all their sender and chat properties and methods. In addition, you can access the `original_update` field which contains the original :tl:`Update`.