mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Replace "type is Type" check with "isinstance"
This commit is contained in:
parent
18e65cbf32
commit
9e88d9d219
|
@ -275,7 +275,7 @@ class InteractiveTelegramClient(TelegramClient):
|
|||
|
||||
@staticmethod
|
||||
def update_handler(update_object):
|
||||
if type(update_object) is UpdateShortMessage:
|
||||
if isinstance(update_object, UpdateShortMessage):
|
||||
if update_object.out:
|
||||
sprint('You sent {} to user #{}'.format(
|
||||
update_object.message, update_object.user_id))
|
||||
|
@ -283,7 +283,7 @@ class InteractiveTelegramClient(TelegramClient):
|
|||
sprint('[User #{} sent {}]'.format(
|
||||
update_object.user_id, update_object.message))
|
||||
|
||||
elif type(update_object) is UpdateShortChatMessage:
|
||||
elif isinstance(update_object, UpdateShortChatMessage):
|
||||
if update_object.out:
|
||||
sprint('You sent {} to chat #{}'.format(
|
||||
update_object.message, update_object.chat_id))
|
||||
|
|
Loading…
Reference in New Issue
Block a user