mirror of
https://github.com/danog/MadelineProtoDocs.git
synced 2024-12-02 17:55:35 +01:00
2.6 KiB
2.6 KiB
title | description | grand_parent | parent | image | redirect_from |
---|---|---|---|---|---|
updates.getDifference | You cannot use this method directly, please use the [event handler](https://docs.madelineproto.xyz/docs/UPDATES.html), instead. | Telegram RPC API | Methods | https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png | /API_docs/methods/updates_getDifference.html |
Method: updates.getDifference
Warning: this is a low-level, complex method that must never be used directly.
The event handler provides a high-level abstraction that must be used instead of this method to fetch updates. If you want to fetch all users of a bot using a bot token, use getDialogIds or the high-level broadcast API, instead.
You cannot use this method directly, please use the event handler, instead.
Parameters:
Name | Type | Description | Required |
---|---|---|---|
pts | int | PTS, see updates. | Optional |
pts_limit | int | PTS limit | Optional |
pts_total_limit | int | For fast updating: if provided and pts + pts_total_limit < remote pts , updates.differenceTooLong will be returned.Simply tells the server to not return the difference if it is bigger than pts_total_limit If the remote pts is too big (> ~4000000), this field will default to 1000000 |
Optional |
date | int | date, see updates. | Optional |
qts | int | QTS, see updates. | Optional |
qts_limit | int | QTS limit | Optional |
Return type: updates.Difference
Can bots use this method: YES
MadelineProto Example (now async for huge speed and parallelism!):
if (!file_exists('madeline.php')) {
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';
$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();
$updates_Difference = $MadelineProto->updates->getDifference(pts: $int, pts_limit: $int, pts_total_limit: $int, date: $int, qts: $int, qts_limit: $int, );