mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-02 11:10:18 +03:00
Apply suggestions from code review
Co-authored-by: Lonami <totufals@hotmail.com>
This commit is contained in:
parent
3fb8d7fa63
commit
a6e8f93d30
|
@ -426,7 +426,8 @@ class UpdateMethods:
|
|||
await builder.resolve(self)
|
||||
|
||||
filter = builder.filter(event)
|
||||
filter = (await filter) if inspect.isawaitable(filter) else filter
|
||||
if inspect.isawaitable(filter):
|
||||
filter = await filter
|
||||
if not filter:
|
||||
continue
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ class EventBuilder(abc.ABC):
|
|||
if not self.func:
|
||||
return True
|
||||
|
||||
# Return the result of func directly as it may need to be awaited
|
||||
return self.func(event)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user