Merge branch 'master' of https://github.com/danog/MadelineProto
This commit is contained in:
commit
7f6481a3fe
4
bot.php
4
bot.php
@ -30,10 +30,9 @@ try {
|
|||||||
$offset = 0;
|
$offset = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
$updates = $MadelineProto->API->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout
|
$updates = $MadelineProto->API->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout
|
||||||
var_dump($updates);
|
\danog\MadelineProto\Logger::log([$updates]);
|
||||||
foreach ($updates as $update) {
|
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
|
$offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id
|
||||||
//var_dump($update);
|
|
||||||
switch ($update['update']['_']) {
|
switch ($update['update']['_']) {
|
||||||
case 'updateNewMessage':
|
case 'updateNewMessage':
|
||||||
case 'updateNewChannelMessage':
|
case 'updateNewChannelMessage':
|
||||||
@ -45,7 +44,6 @@ while (true) {
|
|||||||
$res = var_export($update, true);
|
$res = var_export($update, true);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
//var_dump($update);
|
|
||||||
$MadelineProto->messages->sendMessage(['peer' => $update['update']['message']['to_id'], 'message' => $res, 'reply_to_msg_id' => $update['update']['message']['id'], 'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]);
|
$MadelineProto->messages->sendMessage(['peer' => $update['update']['message']['to_id'], 'message' => $res, 'reply_to_msg_id' => $update['update']['message']['id'], 'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]);
|
||||||
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
||||||
$MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => $e->getCode().': '.$e->getMessage().PHP_EOL.$e->getTraceAsString()]);
|
$MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => $e->getCode().': '.$e->getMessage().PHP_EOL.$e->getTraceAsString()]);
|
||||||
|
@ -18,12 +18,12 @@ $uMadelineProto = false;
|
|||||||
try {
|
try {
|
||||||
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('pipesbot.madeline');
|
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('pipesbot.madeline');
|
||||||
} catch (\danog\MadelineProto\Exception $e) {
|
} catch (\danog\MadelineProto\Exception $e) {
|
||||||
var_dump($e->getMessage());
|
\danog\MadelineProto\Logger::log([$e->getMessage()]);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$uMadelineProto = \danog\MadelineProto\Serialization::deserialize('pwr.madeline');
|
$uMadelineProto = \danog\MadelineProto\Serialization::deserialize('pwr.madeline');
|
||||||
} catch (\danog\MadelineProto\Exception $e) {
|
} catch (\danog\MadelineProto\Exception $e) {
|
||||||
var_dump($e->getMessage());
|
\danog\MadelineProto\Logger::log([$e->getMessage()]);
|
||||||
}
|
}
|
||||||
if (file_exists('token.php') && $MadelineProto === false) {
|
if (file_exists('token.php') && $MadelineProto === false) {
|
||||||
include_once 'token.php';
|
include_once 'token.php';
|
||||||
@ -110,7 +110,6 @@ while (true) {
|
|||||||
$offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id
|
$offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id
|
||||||
switch ($update['update']['_']) {
|
switch ($update['update']['_']) {
|
||||||
case 'updateNewMessage':
|
case 'updateNewMessage':
|
||||||
var_dump($update);
|
|
||||||
if (isset($update['update']['message']['out']) && $update['update']['message']['out']) {
|
if (isset($update['update']['message']['out']) && $update['update']['message']['out']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -97,16 +97,13 @@ function getfiles($token, &$params)
|
|||||||
$offset = 0;
|
$offset = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
$updates = $MadelineProto->API->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout
|
$updates = $MadelineProto->API->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout
|
||||||
//var_dump($updates);
|
|
||||||
foreach ($updates as $update) {
|
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
|
$offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id
|
||||||
//var_dump($update);
|
|
||||||
switch ($update['update']['_']) {
|
switch ($update['update']['_']) {
|
||||||
case 'updateNewMessage':
|
case 'updateNewMessage':
|
||||||
if (isset($update['update']['message']['out']) && $update['update']['message']['out']) {
|
if (isset($update['update']['message']['out']) && $update['update']['message']['out']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var_dump($update);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isset($update['update']['message']['media'])) {
|
if (isset($update['update']['message']['media'])) {
|
||||||
@ -142,7 +139,6 @@ var_dump($update);
|
|||||||
if (isset($update['update']['message']['media']['document'])) {
|
if (isset($update['update']['message']['media']['document'])) {
|
||||||
$mtproto['access_hash'] = $update['update']['message']['media']['document']['access_hash'];
|
$mtproto['access_hash'] = $update['update']['message']['media']['document']['access_hash'];
|
||||||
}
|
}
|
||||||
//var_dump($mtproto);
|
|
||||||
foreach ($mtproto as $key => $n) {
|
foreach ($mtproto as $key => $n) {
|
||||||
foreach ($bot_api as $bn) {
|
foreach ($bot_api as $bn) {
|
||||||
if ($bn['number'] === $n) {
|
if ($bn['number'] === $n) {
|
||||||
|
@ -21,17 +21,15 @@ try {
|
|||||||
$offset = 0;
|
$offset = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
$updates = $MadelineProto->API->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout
|
$updates = $MadelineProto->API->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout
|
||||||
var_dump($updates);
|
\danog\MadelineProto\Logger::log([$updates]);
|
||||||
foreach ($updates as $update) {
|
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
|
$offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id
|
||||||
//var_dump($update);
|
|
||||||
switch ($update['update']['_']) {
|
switch ($update['update']['_']) {
|
||||||
case 'updateNewMessage':
|
case 'updateNewMessage':
|
||||||
if (isset($update['update']['message']['out']) && $update['update']['message']['out']) {
|
if (isset($update['update']['message']['out']) && $update['update']['message']['out']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
//var_dump($update);
|
|
||||||
if ($update['update']['message']['message'] === 'callstorm') {
|
if ($update['update']['message']['message'] === 'callstorm') {
|
||||||
$MadelineProto->messages->sendMessage(['peer' => $update['update']['message']['from_id'], 'message' => 'callstorming you', 'reply_to_msg_id' => $update['update']['message']['id']]);
|
$MadelineProto->messages->sendMessage(['peer' => $update['update']['message']['from_id'], 'message' => 'callstorming you', 'reply_to_msg_id' => $update['update']['message']['id']]);
|
||||||
echo 'Wrote '.\danog\MadelineProto\Serialization::serialize('calls.madeline', $MadelineProto).' bytes'.PHP_EOL;
|
echo 'Wrote '.\danog\MadelineProto\Serialization::serialize('calls.madeline', $MadelineProto).' bytes'.PHP_EOL;
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -121,7 +121,7 @@ $MadelineProto = new \danog\MadelineProto\API();
|
|||||||
### Settings
|
### Settings
|
||||||
|
|
||||||
The constructor accepts an optional parameter, which is the settings array. This array contains some other arrays, which are the settings for a specific MadelineProto function.
|
The constructor accepts an optional parameter, which is the settings array. This array contains some other arrays, which are the settings for a specific MadelineProto function.
|
||||||
See [here](https://github.com/danog/MadelineProto/blob/master/src/danog/MadelineProto/MTProto.php#L99) for the default values for the settings arrays and explanations for every setting.
|
See [here](https://github.com/danog/MadelineProto/blob/master/src/danog/MadelineProto/MTProto.php#L232) for the default values for the settings arrays and explanations for every setting.
|
||||||
|
|
||||||
You can provide part of any subsetting array, that way the remaining arrays will be automagically set to default and undefined values of specified subsetting arrays will be set to the default values.
|
You can provide part of any subsetting array, that way the remaining arrays will be automagically set to default and undefined values of specified subsetting arrays will be set to the default values.
|
||||||
Example:
|
Example:
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
@ -5,4 +5,4 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
47
src/danog/MadelineProto/DocsBuilder.php
Executable file → Normal file
47
src/danog/MadelineProto/DocsBuilder.php
Executable file → Normal file
@ -601,7 +601,7 @@ $'.$type.' = -147286699; // Numeric chat id returned by request_secret_chat, can
|
|||||||
|
|
||||||
';
|
';
|
||||||
if (file_exists('types/'.$type.'.md')) {
|
if (file_exists('types/'.$type.'.md')) {
|
||||||
var_dump($type);
|
\danog\MadelineProto\Logger::log([$type]);
|
||||||
}
|
}
|
||||||
file_put_contents('types/'.$type.'.md', $header.$constructors.$methods);
|
file_put_contents('types/'.$type.'.md', $header.$constructors.$methods);
|
||||||
$last_namespace = $new_namespace;
|
$last_namespace = $new_namespace;
|
||||||
@ -628,7 +628,8 @@ description: A UTF8 string of variable length
|
|||||||
## Type: string
|
## Type: string
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.');
|
A string of variable length. The total length in bytes of the string must not be bigger than 16777215.
|
||||||
|
');
|
||||||
file_put_contents('types/bytes.md', '---
|
file_put_contents('types/bytes.md', '---
|
||||||
title: bytes
|
title: bytes
|
||||||
description: A string of variable length
|
description: A string of variable length
|
||||||
@ -636,7 +637,8 @@ description: A string of variable length
|
|||||||
## Type: bytes
|
## Type: bytes
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A string of variable length.');
|
A string of variable length, with length smaller than or equal to 16777215.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/int.md', '---
|
file_put_contents('types/int.md', '---
|
||||||
title: integer
|
title: integer
|
||||||
@ -645,7 +647,8 @@ description: A 32 bit signed integer ranging from -2147483647 to 2147483647
|
|||||||
## Type: int
|
## Type: int
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A 32 bit signed integer ranging from `-2147483647` to `2147483647`.');
|
A 32 bit signed integer ranging from `-2147483647` to `2147483647`.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/long.md', '---
|
file_put_contents('types/long.md', '---
|
||||||
title: long
|
title: long
|
||||||
@ -654,7 +657,8 @@ description: A 32 bit signed integer ranging from -9223372036854775807 to 922337
|
|||||||
## Type: long
|
## Type: long
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A 64 bit signed integer ranging from `-9223372036854775807` to `9223372036854775807`.');
|
A 64 bit signed integer ranging from `-9223372036854775807` to `9223372036854775807`.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/int128.md', '---
|
file_put_contents('types/int128.md', '---
|
||||||
title: int128
|
title: int128
|
||||||
@ -663,7 +667,8 @@ description: A 128 bit signed integer
|
|||||||
## Type: int128
|
## Type: int128
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A 128 bit signed integer represented in little-endian base256 (`string`) format.');
|
A 128 bit signed integer represented in little-endian base256 (`string`) format.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/int256.md', '---
|
file_put_contents('types/int256.md', '---
|
||||||
title: int256
|
title: int256
|
||||||
@ -672,7 +677,8 @@ description: A 256 bit signed integer
|
|||||||
## Type: int256
|
## Type: int256
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A 256 bit signed integer represented in little-endian base256 (`string`) format.');
|
A 256 bit signed integer represented in little-endian base256 (`string`) format.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/int512.md', '---
|
file_put_contents('types/int512.md', '---
|
||||||
title: int512
|
title: int512
|
||||||
@ -681,7 +687,8 @@ description: A 512 bit signed integer
|
|||||||
## Type: int512
|
## Type: int512
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A 512 bit signed integer represented in little-endian base256 (`string`) format.');
|
A 512 bit signed integer represented in little-endian base256 (`string`) format.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/double.md', '---
|
file_put_contents('types/double.md', '---
|
||||||
title: double
|
title: double
|
||||||
@ -690,7 +697,8 @@ description: A double precision floating point number
|
|||||||
## Type: double
|
## Type: double
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
A double precision floating point number, single precision can also be used (float).');
|
A double precision floating point number, single precision can also be used (float).
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/!X.md', '---
|
file_put_contents('types/!X.md', '---
|
||||||
title: !X
|
title: !X
|
||||||
@ -699,7 +707,8 @@ description: Represents a TL serialized payload
|
|||||||
## Type: !X
|
## Type: !X
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
Represents a TL serialized payload.');
|
Represents a TL serialized payload.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/X.md', '---
|
file_put_contents('types/X.md', '---
|
||||||
title: X
|
title: X
|
||||||
@ -708,7 +717,8 @@ description: Represents a TL serialized payload
|
|||||||
## Type: X
|
## Type: X
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
Represents a TL serialized payload.');
|
Represents a TL serialized payload.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('constructors/boolFalse.md', '---
|
file_put_contents('constructors/boolFalse.md', '---
|
||||||
title: boolFalse
|
title: boolFalse
|
||||||
@ -717,7 +727,8 @@ description: Represents a boolean with value equal to false
|
|||||||
# boolFalse
|
# boolFalse
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
Represents a boolean with value equal to `false`.');
|
Represents a boolean with value equal to `false`.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('constructors/boolTrue.md', '---
|
file_put_contents('constructors/boolTrue.md', '---
|
||||||
title: boolTrue
|
title: boolTrue
|
||||||
@ -726,7 +737,8 @@ description: Represents a boolean with value equal to true
|
|||||||
# boolTrue
|
# boolTrue
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
Represents a boolean with value equal to `true`.');
|
Represents a boolean with value equal to `true`.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('constructors/null.md', '---
|
file_put_contents('constructors/null.md', '---
|
||||||
title: null
|
title: null
|
||||||
@ -735,7 +747,8 @@ description: Represents a null value
|
|||||||
# null
|
# null
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
Represents a `null` value.');
|
Represents a `null` value.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/Bool.md', '---
|
file_put_contents('types/Bool.md', '---
|
||||||
title: Bool
|
title: Bool
|
||||||
@ -744,7 +757,8 @@ description: Represents a boolean.
|
|||||||
# Bool
|
# Bool
|
||||||
[Back to types index](index.md)
|
[Back to types index](index.md)
|
||||||
|
|
||||||
Represents a boolean.');
|
Represents a boolean.
|
||||||
|
');
|
||||||
|
|
||||||
file_put_contents('types/DataJSON.md', '---
|
file_put_contents('types/DataJSON.md', '---
|
||||||
title: DataJSON
|
title: DataJSON
|
||||||
@ -753,7 +767,8 @@ description: Any json-encodable data
|
|||||||
## Type: DataJSON
|
## Type: DataJSON
|
||||||
[Back to constructor index](index.md)
|
[Back to constructor index](index.md)
|
||||||
|
|
||||||
Any json-encodable data.');
|
Any json-encodable data.
|
||||||
|
');
|
||||||
|
|
||||||
\danog\MadelineProto\Logger::log(['Done!'], \danog\MadelineProto\Logger::NOTICE);
|
\danog\MadelineProto\Logger::log(['Done!'], \danog\MadelineProto\Logger::NOTICE);
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,6 @@ class MTProto
|
|||||||
if (!$this->readers[$dc]->isRunning()) {
|
if (!$this->readers[$dc]->isRunning()) {
|
||||||
$this->readers[$dc]->garbage = false;
|
$this->readers[$dc]->garbage = false;
|
||||||
$this->reader_pool->submit($this->readers[$dc]);
|
$this->reader_pool->submit($this->readers[$dc]);
|
||||||
var_dump('hey');
|
|
||||||
Logger::log(['Socket reader on DC '.$dc.': RESTARTED'], Logger::WARNING);
|
Logger::log(['Socket reader on DC '.$dc.': RESTARTED'], Logger::WARNING);
|
||||||
while (!$this->readers[$dc]->ready);
|
while (!$this->readers[$dc]->ready);
|
||||||
} else {
|
} else {
|
||||||
|
@ -166,7 +166,7 @@ trait CallHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($server_answer === null) {
|
if ($server_answer === null) {
|
||||||
if ($last_recv === $this->last_recv && $this->datacenter->sockets[$args['datacenter']]->temp_auth_key != null) {
|
if ($last_recv === $this->last_recv && $this->datacenter->sockets[$args['datacenter']]->temp_auth_key !== null) {
|
||||||
\danog\MadelineProto\Logger::log(['WARNING: Resetting auth key...'], \danog\MadelineProto\Logger::WARNING);
|
\danog\MadelineProto\Logger::log(['WARNING: Resetting auth key...'], \danog\MadelineProto\Logger::WARNING);
|
||||||
$this->datacenter->sockets[$args['datacenter']]->temp_auth_key = null;
|
$this->datacenter->sockets[$args['datacenter']]->temp_auth_key = null;
|
||||||
$this->init_authorization();
|
$this->init_authorization();
|
||||||
|
@ -60,7 +60,7 @@ trait MessageHandler
|
|||||||
if (strlen($payload) === 4) {
|
if (strlen($payload) === 4) {
|
||||||
$error = \danog\PHP\Struct::unpack('<i', $payload)[0];
|
$error = \danog\PHP\Struct::unpack('<i', $payload)[0];
|
||||||
if ($error === -404) {
|
if ($error === -404) {
|
||||||
if ($this->datacenter->sockets[$datacenter]->temp_auth_key != null) {
|
if ($this->datacenter->sockets[$datacenter]->temp_auth_key !== null) {
|
||||||
\danog\MadelineProto\Logger::log(['WARNING: Resetting auth key...'], \danog\MadelineProto\Logger::WARNING);
|
\danog\MadelineProto\Logger::log(['WARNING: Resetting auth key...'], \danog\MadelineProto\Logger::WARNING);
|
||||||
$this->datacenter->sockets[$datacenter]->temp_auth_key = null;
|
$this->datacenter->sockets[$datacenter]->temp_auth_key = null;
|
||||||
$this->init_authorization();
|
$this->init_authorization();
|
||||||
|
@ -52,9 +52,6 @@ trait PeerHandler
|
|||||||
public function add_chats($chats)
|
public function add_chats($chats)
|
||||||
{
|
{
|
||||||
foreach ($chats as $key => $chat) {
|
foreach ($chats as $key => $chat) {
|
||||||
if (!isset($chat['access_hash'])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
switch ($chat['_']) {
|
switch ($chat['_']) {
|
||||||
case 'chat':
|
case 'chat':
|
||||||
case 'chatEmpty':
|
case 'chatEmpty':
|
||||||
@ -75,6 +72,9 @@ trait PeerHandler
|
|||||||
break;
|
break;
|
||||||
case 'channel':
|
case 'channel':
|
||||||
case 'channelForbidden':
|
case 'channelForbidden':
|
||||||
|
if (!isset($chat['access_hash'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!isset($this->chats[$this->to_supergroup($chat['id'])]) || $this->chats[$this->to_supergroup($chat['id'])] !== $chat) {
|
if (!isset($this->chats[$this->to_supergroup($chat['id'])]) || $this->chats[$this->to_supergroup($chat['id'])] !== $chat) {
|
||||||
$this->chats[$this->to_supergroup($chat['id'])] = $chat;
|
$this->chats[$this->to_supergroup($chat['id'])] = $chat;
|
||||||
$this->should_serialize = true;
|
$this->should_serialize = true;
|
||||||
|
@ -426,7 +426,7 @@ trait ResponseHandler
|
|||||||
$this->force_get_updates_difference();
|
$this->force_get_updates_difference();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \danog\MadelineProto\ResponseException('Unrecognized update received: '.var_export($updates));
|
throw new \danog\MadelineProto\ResponseException('Unrecognized update received: '.var_export($updates, true));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ trait ResponseHandler
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \danog\MadelineProto\ResponseException('Unrecognized decrypted message received: '.var_export($update));
|
throw new \danog\MadelineProto\ResponseException('Unrecognized decrypted message received: '.var_export($update, true));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user