Simplify event building logic

This will also fix some bugs where the event type being accessed
would not be available, since it is now built on-demand, without
the need to keep track for the count of each event type.
This commit is contained in:
Lonami Exo
2018-08-21 10:27:12 +02:00
parent f0cd1fdd6e
commit 9f237cc928
3 changed files with 26 additions and 43 deletions

View File

@@ -274,11 +274,6 @@ class TelegramBaseClient(abc.ABC):
self._event_resolve_lock = asyncio.Lock()
self._conversations = {}
# Keep track of how many event builders there are for
# each type {type: count}. If there's at least one then
# the event will be built, and the same event be reused.
self._event_builders_count = collections.defaultdict(int)
# Default parse mode
self._parse_mode = markdown