fix get_dialogs() return type in example

Catching up with 238198db where get_dialogs
return type was changed.
This commit is contained in:
Csaba Henk 2018-01-02 09:56:37 +01:00
parent 33d6afa0bd
commit b9cd9a6639

View File

@ -138,15 +138,15 @@ class InteractiveTelegramClient(TelegramClient):
# Entities represent the user, chat or channel # Entities represent the user, chat or channel
# corresponding to the dialog on the same index. # corresponding to the dialog on the same index.
dialogs, entities = self.get_dialogs(limit=dialog_count) dialogs = self.get_dialogs(limit=dialog_count)
i = None i = None
while i is None: while i is None:
print_title('Dialogs window') print_title('Dialogs window')
# Display them so the user can choose # Display them so the user can choose
for i, entity in enumerate(entities, start=1): for i, dialog in enumerate(dialogs, start=1):
sprint('{}. {}'.format(i, get_display_name(entity))) sprint('{}. {}'.format(i, get_display_name(dialog.entity)))
# Let the user decide who they want to talk to # Let the user decide who they want to talk to
print() print()
@ -177,7 +177,7 @@ class InteractiveTelegramClient(TelegramClient):
i = None i = None
# Retrieve the selected user (or chat, or channel) # Retrieve the selected user (or chat, or channel)
entity = entities[i] entity = dialogs[i].entity
# Show some information # Show some information
print_title('Chat with "{}"'.format(get_display_name(entity))) print_title('Chat with "{}"'.format(get_display_name(entity)))