while (true) {
$updates = $MadelineProto->get_updates(['offset' =>'-1', 'limit' => 10, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout
\danog\MadelineProto\Logger
::log($updates); foreach ($updates as $update) {
$offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id
switch ($update['update']['_']) {
case 'updateNewMessage':
if (isset($update['update']['message']['out']) && $update['update']['message']['out']) { continue;
}
if ($res == '') {
}
$text=$update['update']['message']['message'];
try {
$MadelineProto->messages->sendMessage([
'peer' => $update['update']['message']['from_id'],
'message' => "SALOM","ASSALOMU ALAYKUM","VA ALEYKUM ASSALOM QALAYSIZ O'ZI",
'reply_to_msg_id' => $update['update']['message']['id'],
'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]);
} catch (\danog\MadelineProto\RPCErrorException $e) {
$MadelineProto->messages->sendMessage(['peer' => '@ZEHNLI_NO2_BOT', 'message' => $e->getCode().': '.$e->getMessage().PHP_EOL.$e->getTraceAsString()]);
}
}
}
}
}
DO'STLAR SHU JAVOBNI RANDOM QILIB SOZLASH QANDAY BO'LADI JAVOB UCHUN OLDINDAN KATTA RAHMAT