mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-27 16:29:52 +03:00
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.
This commit is contained in:
parent
3625bf849d
commit
f9ca093289
|
@ -5,6 +5,7 @@ import warnings
|
||||||
from .. import utils
|
from .. import utils
|
||||||
from ..tl import TLObject, types
|
from ..tl import TLObject, types
|
||||||
from ..tl.custom.chatgetter import ChatGetter
|
from ..tl.custom.chatgetter import ChatGetter
|
||||||
|
from ..tl.custom.sendergetter import SenderGetter
|
||||||
|
|
||||||
|
|
||||||
async def _into_id_set(client, chats):
|
async def _into_id_set(client, chats):
|
||||||
|
@ -127,13 +128,14 @@ class EventBuilder(abc.ABC):
|
||||||
return self.func(event)
|
return self.func(event)
|
||||||
|
|
||||||
|
|
||||||
class EventCommon(ChatGetter, abc.ABC):
|
class EventCommon(SenderGetter, ChatGetter, abc.ABC):
|
||||||
"""
|
"""
|
||||||
Intermediate class with common things to all events.
|
Intermediate class with common things to all events.
|
||||||
|
|
||||||
Remember that this class implements `ChatGetter
|
Remember that this class implements `ChatGetter
|
||||||
<telethon.tl.custom.chatgetter.ChatGetter>` which
|
<telethon.tl.custom.chatgetter.ChatGetter>` and `SenderGetter
|
||||||
means you have access to all chat properties and methods.
|
<telethon.tl.custom.sendergetter.SenderGetter>` which means you
|
||||||
|
have access to all their sender and chat properties and methods.
|
||||||
|
|
||||||
In addition, you can access the `original_update`
|
In addition, you can access the `original_update`
|
||||||
field which contains the original :tl:`Update`.
|
field which contains the original :tl:`Update`.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user