telethon auto reply messages

i need to write code that will read messages from user and reply but i’ve got to use exactly this function: GetDialogs Request, not event method. please help, can't find any information about it

Upvotes: 0

Views: 334

Answers (1)

Lonami
Lonami

Reputation: 7086

The request you mention, GetDialogsRequest, is part of what's known as "raw API". Both pages of the documentation contain examples. However, as noted in the first link, you probably want to use client.iter_dialogs (the link again contains an example):

# Print all dialog IDs and the title, nicely formatted
async for dialog in client.iter_dialogs():
    print('{:>14}: {}'.format(dialog.id, dialog.title))

This may not be the request you're looking for though, as this returns a list of open conversations. Following the documentation would be a good way to understand what's happening and what you should use.

Upvotes: 1

Related Questions