|
@@ -303,7 +303,7 @@ discard block |
|
|
block discarded – undo |
|
303
|
303
|
'first_name' => 'botname', |
|
304
|
304
|
'username' => 'namebot', |
|
305
|
305
|
]; |
|
306
|
|
- $data['chat'] = ['id' => $data['chat_id']]; |
|
|
306
|
+ $data['chat'] = ['id' => $data['chat_id']]; |
|
307
|
307
|
|
|
308
|
308
|
$fake_response['result'] = $data; |
|
309
|
309
|
} |
|
@@ -337,7 +337,7 @@ discard block |
|
|
block discarded – undo |
|
337
|
337
|
|
|
338
|
338
|
// Reformat data array in multipart way if it contains a resource |
|
339
|
339
|
$has_resource |= (is_resource($item) || $item instanceof Stream); |
|
340
|
|
- $multipart[] = ['name' => $key, 'contents' => $item]; |
|
|
340
|
+ $multipart[] = ['name' => $key, 'contents' => $item]; |
|
341
|
341
|
} |
|
342
|
342
|
|
|
343
|
343
|
if ($has_resource) { |
|
@@ -425,7 +425,7 @@ discard block |
|
|
block discarded – undo |
|
425
|
425
|
'/bot' . self::$telegram->getApiKey() . '/' . $action, |
|
426
|
426
|
$request_params |
|
427
|
427
|
); |
|
428
|
|
- $result = (string) $response->getBody(); |
|
|
428
|
+ $result = (string) $response->getBody(); |
|
429
|
429
|
|
|
430
|
430
|
//Logging getUpdates Update |
|
431
|
431
|
if ($action === 'getUpdates') { |
|
@@ -768,8 +768,8 @@ discard block |
|
|
block discarded – undo |
|
768
|
768
|
$requests = DB::getTelegramRequestCount($chat_id, $inline_message_id); |
|
769
|
769
|
|
|
770
|
770
|
$chat_per_second = ($requests['LIMIT_PER_SEC'] == 0); // No more than one message per second inside a particular chat |
|
771
|
|
- $global_per_second = ($requests['LIMIT_PER_SEC_ALL'] < 30); // No more than 30 messages per second to different chats |
|
772
|
|
- $groups_per_minute = (((is_numeric($chat_id) && $chat_id > 0) || !is_null($inline_message_id)) || ((!is_numeric($chat_id) || $chat_id < 0) && $requests['LIMIT_PER_MINUTE'] < 20)); // No more than 20 messages per minute in groups and channels |
|
|
771
|
+ $global_per_second = ($requests['LIMIT_PER_SEC_ALL'] < 30); // No more than 30 messages per second to different chats |
|
|
772
|
+ $groups_per_minute = (((is_numeric($chat_id) && $chat_id > 0) || !is_null($inline_message_id)) || ((!is_numeric($chat_id) || $chat_id < 0) && $requests['LIMIT_PER_MINUTE'] < 20)); // No more than 20 messages per minute in groups and channels |
|
773
|
773
|
|
|
774
|
774
|
if ($chat_per_second && $global_per_second && $groups_per_minute) { |
|
775
|
775
|
break; |