Getting all chats (dialogs)

There are two ways to get a list of all chats, depending if you logged in as a user, or as a bot.

getDialogs (now fully async!)

$dialogs = yield $MadelineProto->getDialogs();
foreach ($dialogs as $peer) {
    yield $MadelineProto->messages->sendMessage(['peer' => $peer, 'message' => 'Hi! Testing MadelineProto broadcasting!']);
}

getDialogs will return a full list of all chats you’re member of, see here for the parameters and the result

getFullDialogs (now fully async!)

$dialogs = yield $MadelineProto->getFullDialogs();
foreach ($dialogs as $dialog) {
    $MadelineProto->logger($dialog);
}

getFullDialogs will return a full list of all chats you’re member of, including dialog info (such as the pinned/last message ID, unread count, tag count, notification settings and message drafts) see here for the parameters and the result

Next section

This site uses cookies, as described in the cookie policy. By clicking on "Accept" you consent to the use of cookies.