diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index 62f64991..010a2c44 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -569,7 +569,7 @@ class TelegramClient(TelegramBareClient): some performance loss. """ possible_names = [] - if not isinstance(entity, TLObject) or type(entity).SUBCLASS_OF_ID in ( + if not isinstance(entity, TLObject) or type(entity).subclass_of_id in ( 0x2da17977, 0xc5af5d94, 0x1f4661b9, 0xd49a2697 ): # Maybe it is an user or a chat? Or their full versions? diff --git a/telethon_examples/interactive_telegram_client.py b/telethon_examples/interactive_telegram_client.py index 031a78cd..754d0e8b 100644 --- a/telethon_examples/interactive_telegram_client.py +++ b/telethon_examples/interactive_telegram_client.py @@ -94,11 +94,11 @@ class InteractiveTelegramClient(TelegramClient): # Enter a while loop to chat as long as the user wants while True: # Retrieve the top dialogs - dialog_count = 15 + dialog_count = 10 # Entities represent the user, chat or channel # corresponding to the dialog on the same index - dialogs, entities = self.get_dialogs(limit=dialog_count) + dialogs, entities = self.get_dialogs(dialog_count) i = None while i is None: @@ -141,7 +141,6 @@ class InteractiveTelegramClient(TelegramClient): print(' !h: prints the latest messages (message History).') print(' !up : Uploads and sends the Photo from path.') print(' !uf : Uploads and sends the File from path.') - print(' !d : Deletes a message by its id') print(' !dm : Downloads the given message Media (if any).') print(' !dp: Downloads the current dialog Profile picture.') print() @@ -207,13 +206,6 @@ class InteractiveTelegramClient(TelegramClient): # Slice the message to get the path self.send_document(path=msg[len('!uf '):], entity=entity) - # Delete messages - elif msg.startswith('!d '): - # Slice the message to get message ID - deleted_msg = self.delete_messages(entity, msg[len('!d '):]) - print('Deleted. {}'.format(deleted_msg)) - - # Download media elif msg.startswith('!dm '): # Slice the message to get message ID