@@ -11,11 +11,11 @@ discard block |
||
11 | 11 | use JetBrains\PhpStorm\ArrayShape; |
12 | 12 | |
13 | 13 | class exec extends webhook { |
14 | - public static function init(): string|null { |
|
14 | + public static function init(): string | null { |
|
15 | 15 | return self::getUpdate(); |
16 | 16 | } |
17 | 17 | |
18 | - private static function getUpdate (): string|null { |
|
18 | + private static function getUpdate(): string | null { |
|
19 | 19 | $up = glob('*.update'); |
20 | 20 | if (isset($up[0])) { |
21 | 21 | $up = end($up); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | return $update; |
27 | 27 | } |
28 | 28 | else { |
29 | - logger::write('not authorized access denied. IP : '. $_SERVER['REMOTE_ADDR'] ?? 'unknown',loggerTypes::WARNING); |
|
29 | + logger::write('not authorized access denied. IP : '.$_SERVER['REMOTE_ADDR'] ?? 'unknown', loggerTypes::WARNING); |
|
30 | 30 | BPT::exit(); |
31 | 31 | } |
32 | 32 | } |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | private static function create($file) { |
49 | - file_put_contents('receiver.php', '<?php $BPT = file_get_contents("php://input");$id = json_decode($BPT, true)[\'update_id\'];file_put_contents("{$_SERVER[\'REMOTE_ADDR\']}-$id.update",$BPT);exec("php ' . $file . ' > /dev/null &");'); |
|
49 | + file_put_contents('receiver.php', '<?php $BPT = file_get_contents("php://input");$id = json_decode($BPT, true)[\'update_id\'];file_put_contents("{$_SERVER[\'REMOTE_ADDR\']}-$id.update",$BPT);exec("php '.$file.' > /dev/null &");'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | private static function setURLS(): array { |
53 | - $base_url = (isset(settings::$certificate) ? 'http://' : 'https://') . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; |
|
53 | + $base_url = (isset(settings::$certificate) ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
|
54 | 54 | return [ |
55 | 55 | 'url'=>str_replace(basename($_SERVER['REQUEST_URI']), 'receiver.php', $base_url), |
56 | 56 | 'file'=>basename($_SERVER['SCRIPT_NAME']) |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | use JetBrains\PhpStorm\ArrayShape; |
12 | 12 | |
13 | 13 | class curl extends webhook { |
14 | - public static function init (): string|null { |
|
14 | + public static function init(): string | null { |
|
15 | 15 | if (self::checkIP()) { |
16 | 16 | return self::getUpdate(); |
17 | 17 | } |
18 | 18 | else { |
19 | - logger::write('not authorized access denied. IP : '. $_SERVER['REMOTE_ADDR'] ?? 'unknown',loggerTypes::WARNING); |
|
19 | + logger::write('not authorized access denied. IP : '.$_SERVER['REMOTE_ADDR'] ?? 'unknown', loggerTypes::WARNING); |
|
20 | 20 | BPT::exit(); |
21 | 21 | } |
22 | 22 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | return $_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR']; |
26 | 26 | } |
27 | 27 | |
28 | - private static function getUpdate (): string { |
|
28 | + private static function getUpdate(): string { |
|
29 | 29 | $input = json_decode(file_get_contents("php://input"), true); |
30 | 30 | webhook::telegramVerify($input['ip']); |
31 | 31 | return $input['update']; |
@@ -35,14 +35,14 @@ discard block |
||
35 | 35 | $urls = self::setURLS(); |
36 | 36 | $file = $urls['file']; |
37 | 37 | $timeout = self::getTimeout($file); |
38 | - self::create($file,$timeout); |
|
38 | + self::create($file, $timeout); |
|
39 | 39 | self::setWebhook($urls['url']); |
40 | 40 | lock::set('BPT-MULTI-CURL'); |
41 | 41 | } |
42 | 42 | |
43 | - private static function getTimeout($url): float|int { |
|
43 | + private static function getTimeout($url): float | int { |
|
44 | 44 | $times = []; |
45 | - for ($i = 0; $i < 10; $i ++) { |
|
45 | + for ($i = 0; $i < 10; $i++) { |
|
46 | 46 | $ch = curl_init($url); |
47 | 47 | curl_setopt_array($ch, [CURLOPT_POSTFIELDS => json_encode([]), CURLOPT_TIMEOUT_MS => 100, CURLOPT_NOBODY => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_CONNECTTIMEOUT_MS => 100, CURLOPT_HTTPHEADER => ['accept: application/json', 'content-type: application/json']]); |
48 | 48 | $start = microtime(true); |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | return $timeout > 50 ? $timeout + 10 : 50; |
54 | 54 | } |
55 | 55 | |
56 | - private static function create($file,$timeout) { |
|
57 | - file_put_contents('receiver.php', '<?php http_response_code(200);ignore_user_abort();$ch = curl_init(\'' . $file . '\');curl_setopt_array($ch, [CURLOPT_POSTFIELDS => json_encode([\'update\'=>file_get_contents(\'php://input\'),\'ip\'=>$_SERVER[\'REMOTE_ADDR\']]), CURLOPT_TIMEOUT_MS => ' . $timeout . ', CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_CONNECTTIMEOUT_MS => ' . $timeout . ', CURLOPT_HTTPHEADER => [\'accept: application/json\', \'content-type: application/json\']]);curl_exec($ch);curl_close($ch);?>'); |
|
56 | + private static function create($file, $timeout) { |
|
57 | + file_put_contents('receiver.php', '<?php http_response_code(200);ignore_user_abort();$ch = curl_init(\''.$file.'\');curl_setopt_array($ch, [CURLOPT_POSTFIELDS => json_encode([\'update\'=>file_get_contents(\'php://input\'),\'ip\'=>$_SERVER[\'REMOTE_ADDR\']]), CURLOPT_TIMEOUT_MS => '.$timeout.', CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_CONNECTTIMEOUT_MS => '.$timeout.', CURLOPT_HTTPHEADER => [\'accept: application/json\', \'content-type: application/json\']]);curl_exec($ch);curl_close($ch);?>'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | private static function setURLS(): array { |
61 | - $base_url = (isset(settings::$certificate) ? 'http://' : 'https://') . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; |
|
61 | + $base_url = (isset(settings::$certificate) ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
|
62 | 62 | $file = basename($_SERVER['REQUEST_URI']); |
63 | 63 | return [ |
64 | 64 | 'url'=>str_replace($file, 'receiver.php', $base_url), |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | protected static function telegramVerify(string $ip = null): void { |
23 | 23 | if (settings::$telegram_verify) { |
24 | 24 | if (!tools::isTelegram($ip ?? $_SERVER['REMOTE_ADDR'] ?? '')) { |
25 | - logger::write('not authorized access denied. IP : '. $ip ?? $_SERVER['REMOTE_ADDR'] ?? 'unknown',loggerTypes::WARNING); |
|
25 | + logger::write('not authorized access denied. IP : '.$ip ?? $_SERVER['REMOTE_ADDR'] ?? 'unknown', loggerTypes::WARNING); |
|
26 | 26 | BPT::exit(); |
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | - protected static function processUpdate(string|stdClass|update $update = null): void { |
|
31 | + protected static function processUpdate(string | stdClass | update $update = null): void { |
|
32 | 32 | if (!is_object($update)) { |
33 | 33 | $update = json_decode($update ?? file_get_contents("php://input")); |
34 | 34 | if (!$update) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | - if (!is_a($update,'update')) { |
|
39 | + if (!is_a($update, 'update')) { |
|
40 | 40 | $update = new update($update); |
41 | 41 | } |
42 | 42 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | self::processHandler(); |
46 | 46 | } |
47 | 47 | |
48 | - protected static function setMessageExtra (update &$update): void { |
|
48 | + protected static function setMessageExtra(update & $update): void { |
|
49 | 49 | if ((isset($update->message) && isset($update->message->text)) || (isset($update->edited_message) && isset($update->edited_message->text))) { |
50 | 50 | $type = isset($update->message) ? 'message' : 'edited_message'; |
51 | 51 | $text = &$update->$type->text; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | BPT::$handler->something_else(BPT::$update); |
94 | 94 | } |
95 | 95 | else { |
96 | - logger::write('Update received but handlers does not set',loggerTypes::WARNING); |
|
96 | + logger::write('Update received but handlers does not set', loggerTypes::WARNING); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -11,25 +11,25 @@ discard block |
||
11 | 11 | use BPT\types\update; |
12 | 12 | |
13 | 13 | class getUpdates extends receiver { |
14 | - public static function init () { |
|
14 | + public static function init() { |
|
15 | 15 | $last_update_id = self::loadData(); |
16 | - while(true) { |
|
16 | + while (true) { |
|
17 | 17 | if (!lock::exist('getUpdate')) { |
18 | - $updates = telegram::getUpdates($last_update_id,allowed_updates: settings::$allowed_updates); |
|
18 | + $updates = telegram::getUpdates($last_update_id, allowed_updates: settings::$allowed_updates); |
|
19 | 19 | if (telegram::$status) { |
20 | 20 | self::handleUpdates($updates); |
21 | - lock::save('getUpdate',BPT::$update->update_id+1); |
|
22 | - $last_update_id = BPT::$update->update_id+1; |
|
21 | + lock::save('getUpdate', BPT::$update->update_id + 1); |
|
22 | + $last_update_id = BPT::$update->update_id + 1; |
|
23 | 23 | } |
24 | 24 | else { |
25 | - logger::write("There is some problem happened , telegram response : \n".json_encode($updates),loggerTypes::ERROR); |
|
26 | - BPT::exit(print_r($updates,true)); |
|
25 | + logger::write("There is some problem happened , telegram response : \n".json_encode($updates), loggerTypes::ERROR); |
|
26 | + BPT::exit(print_r($updates, true)); |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | - private static function loadData(): bool|int|string { |
|
32 | + private static function loadData(): bool | int | string { |
|
33 | 33 | if (lock::exist('getUpdate')) { |
34 | 34 | $last_update_id = lock::read('getUpdate'); |
35 | 35 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | self::deleteOldLocks(); |
38 | 38 | telegram::deleteWebhook(); |
39 | 39 | $last_update_id = 0; |
40 | - lock::save('getUpdate',0); |
|
40 | + lock::save('getUpdate', 0); |
|
41 | 41 | } |
42 | 42 | return $last_update_id; |
43 | 43 | } |
@@ -11,32 +11,32 @@ discard block |
||
11 | 11 | class answer { |
12 | 12 | private static bool $is_answered = false; |
13 | 13 | |
14 | - public static function init(string $method,array $data): bool { |
|
14 | + public static function init(string $method, array $data): bool { |
|
15 | 15 | self::checkAnswered(); |
16 | 16 | self::checkWebhook(); |
17 | 17 | self::sieveData($data); |
18 | 18 | self::$is_answered = true; |
19 | 19 | $data['method'] = $method; |
20 | 20 | $payload = json_encode($data); |
21 | - header('Content-Type: application/json;Content-Length: ' . strlen($payload)); |
|
21 | + header('Content-Type: application/json;Content-Length: '.strlen($payload)); |
|
22 | 22 | echo $payload; |
23 | 23 | return true; |
24 | 24 | } |
25 | 25 | |
26 | 26 | private static function checkAnswered(): void { |
27 | 27 | if (self::$is_answered) { |
28 | - logger::write('You can use answer mode only once for each webhook update , You already did it!',loggerTypes::ERROR); |
|
28 | + logger::write('You can use answer mode only once for each webhook update , You already did it!', loggerTypes::ERROR); |
|
29 | 29 | throw new bptException('ANSWER_MODE_USED'); |
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
33 | 33 | private static function checkWebhook(): void { |
34 | - if(settings::$receiver === receiver::GETUPDATES) { |
|
35 | - logger::write('Answer mode only work when receiver is webhook',loggerTypes::ERROR); |
|
34 | + if (settings::$receiver === receiver::GETUPDATES) { |
|
35 | + logger::write('Answer mode only work when receiver is webhook', loggerTypes::ERROR); |
|
36 | 36 | throw new bptException('ANSWER_MODE_GETUPDATES'); |
37 | 37 | } |
38 | - elseif(settings::$multi) { |
|
39 | - logger::write('You can not use answer mode when multi setting is on',loggerTypes::ERROR); |
|
38 | + elseif (settings::$multi) { |
|
39 | + logger::write('You can not use answer mode when multi setting is on', loggerTypes::ERROR); |
|
40 | 40 | throw new bptException('ANSWER_MODE_MULTI'); |
41 | 41 | } |
42 | 42 | } |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | unset($data['forgot']); |
47 | 47 | unset($data['return_array']); |
48 | 48 | |
49 | - foreach ($data as $key=>&$value){ |
|
50 | - if (!isset($value)){ |
|
49 | + foreach ($data as $key=>&$value) { |
|
50 | + if (!isset($value)) { |
|
51 | 51 | unset($data[$key]); |
52 | 52 | } |
53 | - elseif (is_array($value) || is_object($value)){ |
|
53 | + elseif (is_array($value) || is_object($value)) { |
|
54 | 54 | $value = json_encode($value); |
55 | 55 | } |
56 | 56 | } |
@@ -448,94 +448,94 @@ discard block |
||
448 | 448 | ]; |
449 | 449 | |
450 | 450 | private const METHODS_KEYS = [ |
451 | - 'getUpdates' => ['offset','limit','timeout','allowed_updates','token','return_array','forgot','answer'], |
|
452 | - 'setWebhook' => ['url','certificate','ip_address','max_connections','allowed_updates','drop_pending_updates','secret_token','token','return_array','forgot','answer'], |
|
453 | - 'deleteWebhook' => ['drop_pending_updates','token','return_array','forgot','answer'], |
|
454 | - 'getWebhookInfo' => ['token','return_array','forgot','answer'], |
|
455 | - 'getMe' => ['token','return_array','forgot','answer'], |
|
456 | - 'logOut' => ['token','return_array','forgot','answer'], |
|
457 | - 'close' => ['token','return_array','forgot','answer'], |
|
458 | - 'sendMessage' => ['text','chat_id','parse_mode','entities','disable_web_page_preview','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
459 | - 'forwardMessage' => ['chat_id','from_chat_id','disable_notification','protect_content','message_id','token','return_array','forgot','answer'], |
|
460 | - 'copyMessage' => ['chat_id','from_chat_id','message_id','caption','parse_mode','caption_entities','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
461 | - 'sendPhoto' => ['photo','chat_id','caption','parse_mode','caption_entities','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
462 | - 'sendAudio' => ['audio','chat_id','caption','parse_mode','caption_entities','duration','performer','title','thumb','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
463 | - 'sendDocument' => ['document','chat_id','thumb','caption','parse_mode','caption_entities','disable_content_type_detection','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
464 | - 'sendVideo' => ['video','chat_id','duration','width','height','thumb','caption','parse_mode','caption_entities','supports_streaming','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
465 | - 'sendAnimation' => ['animation','chat_id','duration','width','height','thumb','caption','parse_mode','caption_entities','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
466 | - 'sendVoice' => ['voice','chat_id','caption','parse_mode','caption_entities','duration','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
467 | - 'sendVideoNote' => ['video_note','chat_id','duration','length','thumb','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
468 | - 'sendMediaGroup' => ['media','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','token','return_array','forgot','answer'], |
|
469 | - 'sendLocation' => ['latitude','longitude','chat_id','horizontal_accuracy','live_period','heading','proximity_alert_radius','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
470 | - 'editMessageLiveLocation' => ['latitude','longitude','chat_id','message_id','inline_message_id','horizontal_accuracy','heading','proximity_alert_radius','reply_markup','token','return_array','forgot','answer'], |
|
471 | - 'stopMessageLiveLocation' => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
|
472 | - 'sendVenue' => ['chat_id','latitude','longitude','title','address','foursquare_id','foursquare_type','google_place_id','google_place_type','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
473 | - 'sendContact' => ['phone_number','first_name','chat_id','last_name','vcard','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
474 | - 'sendPoll' => ['question','options','chat_id','is_anonymous','type','allows_multiple_answers','correct_option_id','explanation','explanation_parse_mode','explanation_entities','open_period','close_date','is_closed','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
475 | - 'sendDice' => ['chat_id','emoji','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
476 | - 'sendChatAction' => ['chat_id','action','token','return_array','forgot','answer'], |
|
477 | - 'getUserProfilePhotos' => ['user_id','offset','limit','token','return_array','forgot','answer'], |
|
478 | - 'getFile' => ['file_id','token','return_array','forgot','answer'], |
|
479 | - 'banChatMember' => ['chat_id','user_id','until_date','revoke_messages','token','return_array','forgot','answer'], |
|
480 | - 'unbanChatMember' => ['chat_id','user_id','only_if_banned','token','return_array','forgot','answer'], |
|
481 | - 'restrictChatMember' => ['permissions','chat_id','user_id','until_date','token','return_array','forgot','answer'], |
|
482 | - 'promoteChatMember' => ['chat_id','user_id','is_anonymous','can_manage_chat','can_post_messages','can_edit_messages','can_delete_messages','can_manage_video_chats','can_restrict_members','can_promote_members','can_change_info','can_invite_users','can_pin_messages','token','return_array','forgot','answer'], |
|
483 | - 'setChatAdministratorCustomTitle' => ['custom_title','chat_id','user_id','token','return_array','forgot','answer'], |
|
484 | - 'banChatSenderChat' => ['sender_chat_id','chat_id','token','return_array','forgot','answer'], |
|
485 | - 'unbanChatSenderChat' => ['sender_chat_id','chat_id','token','return_array','forgot','answer'], |
|
486 | - 'setChatPermissions' => ['permissions','chat_id','token','return_array','forgot','answer'], |
|
487 | - 'exportChatInviteLink' => ['chat_id','token','return_array','forgot','answer'], |
|
488 | - 'createChatInviteLink' => ['chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'], |
|
489 | - 'editChatInviteLink' => ['invite_link','chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'], |
|
490 | - 'revokeChatInviteLink' => ['invite_link','chat_id','token','return_array','forgot','answer'], |
|
491 | - 'approveChatJoinRequest' => ['chat_id','user_id','token','return_array','forgot','answer'], |
|
492 | - 'declineChatJoinRequest' => ['chat_id','user_id','token','return_array','forgot','answer'], |
|
493 | - 'setChatPhoto' => ['photo','chat_id','token','return_array','forgot','answer'], |
|
494 | - 'deleteChatPhoto' => ['chat_id','token','return_array','forgot','answer'], |
|
495 | - 'setChatTitle' => ['title','chat_id','token','return_array','forgot','answer'], |
|
496 | - 'setChatDescription' => ['chat_id','description','token','return_array','forgot','answer'], |
|
497 | - 'pinChatMessage' => ['message_id','chat_id','disable_notification','token','return_array','forgot','answer'], |
|
498 | - 'unpinChatMessage' => ['chat_id','message_id','token','return_array','forgot','answer'], |
|
499 | - 'unpinAllChatMessages' => ['chat_id','token','return_array','forgot','answer'], |
|
500 | - 'leaveChat' => ['chat_id','token','return_array','forgot','answer'], |
|
501 | - 'getChat' => ['chat_id','token','return_array','forgot','answer'], |
|
502 | - 'getChatAdministrators' => ['chat_id','token','return_array','forgot','answer'], |
|
503 | - 'getChatMemberCount' => ['chat_id','token','return_array','forgot','answer'], |
|
504 | - 'getChatMember' => ['chat_id','user_id','token','return_array','forgot','answer'], |
|
505 | - 'setChatStickerSet' => ['sticker_set_name','chat_id','token','return_array','forgot','answer'], |
|
506 | - 'deleteChatStickerSet' => ['chat_id','token','return_array','forgot','answer'], |
|
507 | - 'answerCallbackQuery' => ['callback_query_id','text','show_alert','url','cache_time','token','return_array','forgot','answer'], |
|
508 | - 'setMyCommands' => ['commands','scope','language_code','token','return_array','forgot','answer'], |
|
509 | - 'deleteMyCommands' => ['scope','language_code','token','return_array','forgot','answer'], |
|
510 | - 'getMyCommands' => ['scope','language_code','token','return_array','forgot','answer'], |
|
511 | - 'setChatMenuButton' => ['chat_id','menu_button','token','return_array','forgot','answer'], |
|
512 | - 'getChatMenuButton' => ['chat_id','token','return_array','forgot','answer'], |
|
513 | - 'setMyDefaultAdministratorRights' => ['rights','for_channels','token','return_array','forgot','answer'], |
|
514 | - 'getMyDefaultAdministratorRights' => ['for_channels','token','return_array','forgot','answer'], |
|
515 | - 'editMessageText' => ['text','chat_id','message_id','inline_message_id','parse_mode','entities','disable_web_page_preview','reply_markup','token','return_array','forgot','answer'], |
|
516 | - 'editMessageCaption' => ['chat_id','message_id','inline_message_id','caption','parse_mode','caption_entities','reply_markup','token','return_array','forgot','answer'], |
|
517 | - 'editMessageMedia' => ['media','chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
|
518 | - 'editMessageReplyMarkup' => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
|
519 | - 'stopPoll' => ['chat_id','message_id','reply_markup','token','return_array','forgot','answer'], |
|
520 | - 'deleteMessage' => ['chat_id','message_id','token','return_array','forgot','answer'], |
|
521 | - 'sendSticker' => ['sticker','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
522 | - 'getStickerSet' => ['name','token','return_array','forgot','answer'], |
|
523 | - 'uploadStickerFile' => ['png_sticker','user_id','token','return_array','forgot','answer'], |
|
524 | - 'createNewStickerSet' => ['name','title','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','contains_masks','mask_position','token','return_array','forgot','answer'], |
|
525 | - 'addStickerToSet' => ['name','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','mask_position','token','return_array','forgot','answer'], |
|
526 | - 'setStickerPositionInSet' => ['sticker','position','token','return_array','forgot','answer'], |
|
527 | - 'deleteStickerFromSet' => ['sticker','token','return_array','forgot','answer'], |
|
528 | - 'setStickerSetThumb' => ['name','user_id','thumb','token','return_array','forgot','answer'], |
|
529 | - 'answerInlineQuery' => ['results','inline_query_id','cache_time','is_personal','next_offset','switch_pm_text','switch_pm_parameter','token','return_array','forgot','answer'], |
|
530 | - 'answerWebAppQuery' => ['web_app_query_id','result','token','return_array','forgot','answer'], |
|
531 | - 'sendInvoice' => ['title','description','payload','provider_token','currency','prices','chat_id','max_tip_amount','suggested_tip_amounts','start_parameter','provider_data','photo_url','photo_size','photo_width','photo_height','need_name','need_phone_number','need_email','need_shipping_address','send_phone_number_to_provider','send_email_to_provider','is_flexible','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
532 | - 'createInvoiceLink' => ['title','description','payload','provider_token','currency','prices','max_tip_amount','suggested_tip_amounts','provider_data','photo_url','photo_size','photo_width','photo_height','need_name','need_phone_number','need_email','need_shipping_address','send_phone_number_to_provider','send_email_to_provider','is_flexible','token','return_array','forgot','answer'], |
|
533 | - 'answerShippingQuery' => ['ok','shipping_query_id','shipping_options','error_message','token','return_array','forgot','answer'], |
|
534 | - 'answerPreCheckoutQuery' => ['ok','pre_checkout_query_id','error_message','token','return_array','forgot','answer'], |
|
535 | - 'setPassportDataErrors' => ['errors','user_id','token','return_array','forgot','answer'], |
|
536 | - 'sendGame' => ['game_short_name','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
537 | - 'setGameScore' => ['score','user_id','force','disable_edit_message','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'], |
|
538 | - 'getGameHighScores' => ['user_id','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'], |
|
451 | + 'getUpdates' => ['offset', 'limit', 'timeout', 'allowed_updates', 'token', 'return_array', 'forgot', 'answer'], |
|
452 | + 'setWebhook' => ['url', 'certificate', 'ip_address', 'max_connections', 'allowed_updates', 'drop_pending_updates', 'secret_token', 'token', 'return_array', 'forgot', 'answer'], |
|
453 | + 'deleteWebhook' => ['drop_pending_updates', 'token', 'return_array', 'forgot', 'answer'], |
|
454 | + 'getWebhookInfo' => ['token', 'return_array', 'forgot', 'answer'], |
|
455 | + 'getMe' => ['token', 'return_array', 'forgot', 'answer'], |
|
456 | + 'logOut' => ['token', 'return_array', 'forgot', 'answer'], |
|
457 | + 'close' => ['token', 'return_array', 'forgot', 'answer'], |
|
458 | + 'sendMessage' => ['text', 'chat_id', 'parse_mode', 'entities', 'disable_web_page_preview', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
459 | + 'forwardMessage' => ['chat_id', 'from_chat_id', 'disable_notification', 'protect_content', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
460 | + 'copyMessage' => ['chat_id', 'from_chat_id', 'message_id', 'caption', 'parse_mode', 'caption_entities', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
461 | + 'sendPhoto' => ['photo', 'chat_id', 'caption', 'parse_mode', 'caption_entities', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
462 | + 'sendAudio' => ['audio', 'chat_id', 'caption', 'parse_mode', 'caption_entities', 'duration', 'performer', 'title', 'thumb', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
463 | + 'sendDocument' => ['document', 'chat_id', 'thumb', 'caption', 'parse_mode', 'caption_entities', 'disable_content_type_detection', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
464 | + 'sendVideo' => ['video', 'chat_id', 'duration', 'width', 'height', 'thumb', 'caption', 'parse_mode', 'caption_entities', 'supports_streaming', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
465 | + 'sendAnimation' => ['animation', 'chat_id', 'duration', 'width', 'height', 'thumb', 'caption', 'parse_mode', 'caption_entities', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
466 | + 'sendVoice' => ['voice', 'chat_id', 'caption', 'parse_mode', 'caption_entities', 'duration', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
467 | + 'sendVideoNote' => ['video_note', 'chat_id', 'duration', 'length', 'thumb', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
468 | + 'sendMediaGroup' => ['media', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'token', 'return_array', 'forgot', 'answer'], |
|
469 | + 'sendLocation' => ['latitude', 'longitude', 'chat_id', 'horizontal_accuracy', 'live_period', 'heading', 'proximity_alert_radius', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
470 | + 'editMessageLiveLocation' => ['latitude', 'longitude', 'chat_id', 'message_id', 'inline_message_id', 'horizontal_accuracy', 'heading', 'proximity_alert_radius', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
471 | + 'stopMessageLiveLocation' => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
472 | + 'sendVenue' => ['chat_id', 'latitude', 'longitude', 'title', 'address', 'foursquare_id', 'foursquare_type', 'google_place_id', 'google_place_type', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
473 | + 'sendContact' => ['phone_number', 'first_name', 'chat_id', 'last_name', 'vcard', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
474 | + 'sendPoll' => ['question', 'options', 'chat_id', 'is_anonymous', 'type', 'allows_multiple_answers', 'correct_option_id', 'explanation', 'explanation_parse_mode', 'explanation_entities', 'open_period', 'close_date', 'is_closed', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
475 | + 'sendDice' => ['chat_id', 'emoji', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
476 | + 'sendChatAction' => ['chat_id', 'action', 'token', 'return_array', 'forgot', 'answer'], |
|
477 | + 'getUserProfilePhotos' => ['user_id', 'offset', 'limit', 'token', 'return_array', 'forgot', 'answer'], |
|
478 | + 'getFile' => ['file_id', 'token', 'return_array', 'forgot', 'answer'], |
|
479 | + 'banChatMember' => ['chat_id', 'user_id', 'until_date', 'revoke_messages', 'token', 'return_array', 'forgot', 'answer'], |
|
480 | + 'unbanChatMember' => ['chat_id', 'user_id', 'only_if_banned', 'token', 'return_array', 'forgot', 'answer'], |
|
481 | + 'restrictChatMember' => ['permissions', 'chat_id', 'user_id', 'until_date', 'token', 'return_array', 'forgot', 'answer'], |
|
482 | + 'promoteChatMember' => ['chat_id', 'user_id', 'is_anonymous', 'can_manage_chat', 'can_post_messages', 'can_edit_messages', 'can_delete_messages', 'can_manage_video_chats', 'can_restrict_members', 'can_promote_members', 'can_change_info', 'can_invite_users', 'can_pin_messages', 'token', 'return_array', 'forgot', 'answer'], |
|
483 | + 'setChatAdministratorCustomTitle' => ['custom_title', 'chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
484 | + 'banChatSenderChat' => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
485 | + 'unbanChatSenderChat' => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
486 | + 'setChatPermissions' => ['permissions', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
487 | + 'exportChatInviteLink' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
488 | + 'createChatInviteLink' => ['chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'], |
|
489 | + 'editChatInviteLink' => ['invite_link', 'chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'], |
|
490 | + 'revokeChatInviteLink' => ['invite_link', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
491 | + 'approveChatJoinRequest' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
492 | + 'declineChatJoinRequest' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
493 | + 'setChatPhoto' => ['photo', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
494 | + 'deleteChatPhoto' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
495 | + 'setChatTitle' => ['title', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
496 | + 'setChatDescription' => ['chat_id', 'description', 'token', 'return_array', 'forgot', 'answer'], |
|
497 | + 'pinChatMessage' => ['message_id', 'chat_id', 'disable_notification', 'token', 'return_array', 'forgot', 'answer'], |
|
498 | + 'unpinChatMessage' => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
499 | + 'unpinAllChatMessages' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
500 | + 'leaveChat' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
501 | + 'getChat' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
502 | + 'getChatAdministrators' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
503 | + 'getChatMemberCount' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
504 | + 'getChatMember' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
505 | + 'setChatStickerSet' => ['sticker_set_name', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
506 | + 'deleteChatStickerSet' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
507 | + 'answerCallbackQuery' => ['callback_query_id', 'text', 'show_alert', 'url', 'cache_time', 'token', 'return_array', 'forgot', 'answer'], |
|
508 | + 'setMyCommands' => ['commands', 'scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
509 | + 'deleteMyCommands' => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
510 | + 'getMyCommands' => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
511 | + 'setChatMenuButton' => ['chat_id', 'menu_button', 'token', 'return_array', 'forgot', 'answer'], |
|
512 | + 'getChatMenuButton' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
513 | + 'setMyDefaultAdministratorRights' => ['rights', 'for_channels', 'token', 'return_array', 'forgot', 'answer'], |
|
514 | + 'getMyDefaultAdministratorRights' => ['for_channels', 'token', 'return_array', 'forgot', 'answer'], |
|
515 | + 'editMessageText' => ['text', 'chat_id', 'message_id', 'inline_message_id', 'parse_mode', 'entities', 'disable_web_page_preview', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
516 | + 'editMessageCaption' => ['chat_id', 'message_id', 'inline_message_id', 'caption', 'parse_mode', 'caption_entities', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
517 | + 'editMessageMedia' => ['media', 'chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
518 | + 'editMessageReplyMarkup' => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
519 | + 'stopPoll' => ['chat_id', 'message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
520 | + 'deleteMessage' => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
521 | + 'sendSticker' => ['sticker', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
522 | + 'getStickerSet' => ['name', 'token', 'return_array', 'forgot', 'answer'], |
|
523 | + 'uploadStickerFile' => ['png_sticker', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
524 | + 'createNewStickerSet' => ['name', 'title', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'contains_masks', 'mask_position', 'token', 'return_array', 'forgot', 'answer'], |
|
525 | + 'addStickerToSet' => ['name', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'mask_position', 'token', 'return_array', 'forgot', 'answer'], |
|
526 | + 'setStickerPositionInSet' => ['sticker', 'position', 'token', 'return_array', 'forgot', 'answer'], |
|
527 | + 'deleteStickerFromSet' => ['sticker', 'token', 'return_array', 'forgot', 'answer'], |
|
528 | + 'setStickerSetThumb' => ['name', 'user_id', 'thumb', 'token', 'return_array', 'forgot', 'answer'], |
|
529 | + 'answerInlineQuery' => ['results', 'inline_query_id', 'cache_time', 'is_personal', 'next_offset', 'switch_pm_text', 'switch_pm_parameter', 'token', 'return_array', 'forgot', 'answer'], |
|
530 | + 'answerWebAppQuery' => ['web_app_query_id', 'result', 'token', 'return_array', 'forgot', 'answer'], |
|
531 | + 'sendInvoice' => ['title', 'description', 'payload', 'provider_token', 'currency', 'prices', 'chat_id', 'max_tip_amount', 'suggested_tip_amounts', 'start_parameter', 'provider_data', 'photo_url', 'photo_size', 'photo_width', 'photo_height', 'need_name', 'need_phone_number', 'need_email', 'need_shipping_address', 'send_phone_number_to_provider', 'send_email_to_provider', 'is_flexible', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
532 | + 'createInvoiceLink' => ['title', 'description', 'payload', 'provider_token', 'currency', 'prices', 'max_tip_amount', 'suggested_tip_amounts', 'provider_data', 'photo_url', 'photo_size', 'photo_width', 'photo_height', 'need_name', 'need_phone_number', 'need_email', 'need_shipping_address', 'send_phone_number_to_provider', 'send_email_to_provider', 'is_flexible', 'token', 'return_array', 'forgot', 'answer'], |
|
533 | + 'answerShippingQuery' => ['ok', 'shipping_query_id', 'shipping_options', 'error_message', 'token', 'return_array', 'forgot', 'answer'], |
|
534 | + 'answerPreCheckoutQuery' => ['ok', 'pre_checkout_query_id', 'error_message', 'token', 'return_array', 'forgot', 'answer'], |
|
535 | + 'setPassportDataErrors' => ['errors', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
536 | + 'sendGame' => ['game_short_name', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
537 | + 'setGameScore' => ['score', 'user_id', 'force', 'disable_edit_message', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
538 | + 'getGameHighScores' => ['user_id', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
539 | 539 | ]; |
540 | 540 | |
541 | 541 | private const METHODS_WITH_FILE = [ |
@@ -564,8 +564,8 @@ discard block |
||
564 | 564 | 'logOut' => [], |
565 | 565 | 'close' => [], |
566 | 566 | 'sendMessage' => ['chat_id'], |
567 | - 'forwardMessage' => ['from_chat_id','message_id'], |
|
568 | - 'copyMessage' => ['from_chat_id','message_id'], |
|
567 | + 'forwardMessage' => ['from_chat_id', 'message_id'], |
|
568 | + 'copyMessage' => ['from_chat_id', 'message_id'], |
|
569 | 569 | 'sendPhoto' => ['chat_id'], |
570 | 570 | 'sendAudio' => ['chat_id'], |
571 | 571 | 'sendDocument' => ['chat_id'], |
@@ -581,15 +581,15 @@ discard block |
||
581 | 581 | 'sendContact' => ['chat_id'], |
582 | 582 | 'sendPoll' => ['chat_id'], |
583 | 583 | 'sendDice' => ['chat_id'], |
584 | - 'sendChatAction' => ['chat_id','action'], |
|
584 | + 'sendChatAction' => ['chat_id', 'action'], |
|
585 | 585 | 'getUserProfilePhotos' => ['user_id'], |
586 | 586 | 'getFile' => ['file_id'], |
587 | - 'banChatMember' => ['chat_id','user_id'], |
|
588 | - 'kickChatMember' => ['chat_id','user_id'], |
|
589 | - 'unbanChatMember' => ['chat_id','user_id'], |
|
590 | - 'restrictChatMember' => ['chat_id','user_id'], |
|
591 | - 'promoteChatMember' => ['chat_id','user_id'], |
|
592 | - 'setChatAdministratorCustomTitle' => ['chat_id','user_id'], |
|
587 | + 'banChatMember' => ['chat_id', 'user_id'], |
|
588 | + 'kickChatMember' => ['chat_id', 'user_id'], |
|
589 | + 'unbanChatMember' => ['chat_id', 'user_id'], |
|
590 | + 'restrictChatMember' => ['chat_id', 'user_id'], |
|
591 | + 'promoteChatMember' => ['chat_id', 'user_id'], |
|
592 | + 'setChatAdministratorCustomTitle' => ['chat_id', 'user_id'], |
|
593 | 593 | 'banChatSenderChat' => ['chat_id'], |
594 | 594 | 'unbanChatSenderChat' => ['chat_id'], |
595 | 595 | 'setChatPermissions' => ['chat_id'], |
@@ -597,8 +597,8 @@ discard block |
||
597 | 597 | 'createChatInviteLink' => ['chat_id'], |
598 | 598 | 'editChatInviteLink' => ['chat_id'], |
599 | 599 | 'revokeChatInviteLink' => ['chat_id'], |
600 | - 'approveChatJoinRequest' => ['chat_id','user_id'], |
|
601 | - 'declineChatJoinRequest' => ['chat_id','user_id'], |
|
600 | + 'approveChatJoinRequest' => ['chat_id', 'user_id'], |
|
601 | + 'declineChatJoinRequest' => ['chat_id', 'user_id'], |
|
602 | 602 | 'setChatPhoto' => ['chat_id'], |
603 | 603 | 'deleteChatPhoto' => ['chat_id'], |
604 | 604 | 'setChatTitle' => ['chat_id'], |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | 'getChat' => ['chat_id'], |
611 | 611 | 'getChatAdministrators' => ['chat_id'], |
612 | 612 | 'getChatMembersCount' => ['chat_id'], |
613 | - 'getChatMember' => ['chat_id','user_id'], |
|
613 | + 'getChatMember' => ['chat_id', 'user_id'], |
|
614 | 614 | 'setChatStickerSet' => ['chat_id'], |
615 | 615 | 'deleteChatStickerSet' => ['chat_id'], |
616 | 616 | 'answerCallbackQuery' => ['callback_query_id'], |
@@ -621,12 +621,12 @@ discard block |
||
621 | 621 | 'getChatMenuButton' => [], |
622 | 622 | 'setMyDefaultAdministratorRights' => [], |
623 | 623 | 'getMyDefaultAdministratorRights' => [], |
624 | - 'editMessageText' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
625 | - 'editMessageCaption' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
626 | - 'editMessageMedia' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
627 | - 'editMessageReplyMarkup' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
628 | - 'stopPoll' => ['chat_id','message_id'], |
|
629 | - 'deleteMessage' => ['chat_id','message_id'], |
|
624 | + 'editMessageText' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
625 | + 'editMessageCaption' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
626 | + 'editMessageMedia' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
627 | + 'editMessageReplyMarkup' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
628 | + 'stopPoll' => ['chat_id', 'message_id'], |
|
629 | + 'deleteMessage' => ['chat_id', 'message_id'], |
|
630 | 630 | 'sendSticker' => ['chat_id'], |
631 | 631 | 'getStickerSet' => [], |
632 | 632 | 'uploadStickerFile' => ['user_id'], |
@@ -642,8 +642,8 @@ discard block |
||
642 | 642 | 'answerPreCheckoutQuery' => ['pre_checkout_query_id'], |
643 | 643 | 'setPassportDataErrors' => ['user_id'], |
644 | 644 | 'sendGame' => ['chat_id'], |
645 | - 'setGameScore' => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
646 | - 'getGameHighScores' => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']] |
|
645 | + 'setGameScore' => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
646 | + 'getGameHighScores' => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']] |
|
647 | 647 | ]; |
648 | 648 | |
649 | 649 | private const METHODS_RETURN = [ |
@@ -695,25 +695,25 @@ discard block |
||
695 | 695 | ]; |
696 | 696 | |
697 | 697 | |
698 | - public static function __callStatic (string $name, array $arguments) { |
|
698 | + public static function __callStatic(string $name, array $arguments) { |
|
699 | 699 | if ($action = self::methodAction($name)) { |
700 | - self::keysName($action,$arguments); |
|
701 | - self::readyFile($action,$arguments); |
|
702 | - self::setDefaults($action,$arguments); |
|
700 | + self::keysName($action, $arguments); |
|
701 | + self::readyFile($action, $arguments); |
|
702 | + self::setDefaults($action, $arguments); |
|
703 | 703 | if (isset($arguments['answer'])) { |
704 | - return answer::init($action,$arguments); |
|
704 | + return answer::init($action, $arguments); |
|
705 | 705 | } |
706 | 706 | else { |
707 | - return self::processResponse($action,curl::init($action,$arguments)); |
|
707 | + return self::processResponse($action, curl::init($action, $arguments)); |
|
708 | 708 | } |
709 | 709 | } |
710 | 710 | else { |
711 | - logger::write("$name method is not supported",loggerTypes::ERROR); |
|
711 | + logger::write("$name method is not supported", loggerTypes::ERROR); |
|
712 | 712 | throw new bptException('METHOD_NOT_FOUND'); |
713 | 713 | } |
714 | 714 | } |
715 | 715 | |
716 | - private static function keysName (string $name, array &$arguments): void { |
|
716 | + private static function keysName(string $name, array &$arguments): void { |
|
717 | 717 | foreach ($arguments as $key => $argument) { |
718 | 718 | if (is_numeric($key) && isset(self::METHODS_KEYS[$name][$key])) { |
719 | 719 | $arguments[self::METHODS_KEYS[$name][$key]] = $argument; |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | } |
723 | 723 | } |
724 | 724 | |
725 | - private static function methodAction(string $name): string|false { |
|
725 | + private static function methodAction(string $name): string | false { |
|
726 | 726 | return self::METHODS_ACTION[str_replace('_', '', strtolower($name))] ?? false; |
727 | 727 | } |
728 | 728 | |
@@ -743,11 +743,11 @@ discard block |
||
743 | 743 | } |
744 | 744 | } |
745 | 745 | |
746 | - private static function methodFile(string $name): array|false { |
|
746 | + private static function methodFile(string $name): array | false { |
|
747 | 747 | return self::METHODS_WITH_FILE[$name] ?? false; |
748 | 748 | } |
749 | 749 | |
750 | - private static function methodReturn(string $name,stdClass $response) { |
|
750 | + private static function methodReturn(string $name, stdClass $response) { |
|
751 | 751 | if (isset(self::METHODS_RETURN[$name])) { |
752 | 752 | $return = self::METHODS_RETURN[$name]; |
753 | 753 | if (is_array($return)) { |
@@ -770,13 +770,13 @@ discard block |
||
770 | 770 | $defaults = self::METHODS_EXTRA_DEFAULTS[$name]; |
771 | 771 | foreach ($defaults as $key => $default) { |
772 | 772 | if (is_numeric($key)) { |
773 | - if (!isset($arguments[$default])){ |
|
773 | + if (!isset($arguments[$default])) { |
|
774 | 774 | $arguments[$default] = self::catchFields($default); |
775 | 775 | } |
776 | 776 | } |
777 | 777 | elseif (isset(BPT::$update->$key) || $key === 'other') { |
778 | 778 | foreach ($default as $def) { |
779 | - if (!isset($arguments[$def])){ |
|
779 | + if (!isset($arguments[$def])) { |
|
780 | 780 | $arguments[$def] = self::catchFields($def); |
781 | 781 | } |
782 | 782 | } |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | if ($response->ok) { |
790 | 790 | self::$status = true; |
791 | 791 | self::$pure_response = $response; |
792 | - return self::methodReturn($name,$response); |
|
792 | + return self::methodReturn($name, $response); |
|
793 | 793 | } |
794 | 794 | else { |
795 | 795 | self::$status = false; |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | } |
799 | 799 | } |
800 | 800 | |
801 | - public static function catchFields (string $field): int|string|bool { |
|
801 | + public static function catchFields(string $field): int | string | bool { |
|
802 | 802 | switch ($field) { |
803 | 803 | case 'chat_id' : |
804 | 804 | case 'from_chat_id' : |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | default => false |
935 | 935 | }; |
936 | 936 | case 'url' : |
937 | - return 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; |
|
937 | + return 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
|
938 | 938 | default: |
939 | 939 | return false; |
940 | 940 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | public string $custom_emoji_id; |
50 | 50 | |
51 | 51 | |
52 | - public function __construct(stdClass|null $object = null) { |
|
52 | + public function __construct(stdClass | null $object = null) { |
|
53 | 53 | if ($object != null) { |
54 | 54 | parent::__construct($object, self::subs); |
55 | 55 | } |