mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-06 12:18:04 +03:00
Assert that dispatched updates are Updates
This commit is contained in:
parent
5877459907
commit
40d32cee95
|
@ -543,6 +543,13 @@ class MTProtoSender:
|
||||||
await self._process_message(message)
|
await self._process_message(message)
|
||||||
|
|
||||||
async def _handle_update(self, message):
|
async def _handle_update(self, message):
|
||||||
|
try:
|
||||||
|
assert message.obj.SUBCLASS_OF_ID == 0x8af52aac # crc32(b'Updates')
|
||||||
|
except AssertionError:
|
||||||
|
self._log.warning('Note: %s is not an update, not dispatching it %s', message.obj)
|
||||||
|
return
|
||||||
|
|
||||||
|
print(message.obj.__class__.__name__)
|
||||||
self._log.debug('Handling update %s', message.obj.__class__.__name__)
|
self._log.debug('Handling update %s', message.obj.__class__.__name__)
|
||||||
if self._update_callback:
|
if self._update_callback:
|
||||||
self._update_callback(message.obj)
|
self._update_callback(message.obj)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user