Passed
Push — main ( 959383...f6df14 )
by Miaad
01:38
created
receiver/getUpdates.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,25 +13,25 @@  discard block
 block discarded – undo
13 13
 use stdClass;
14 14
 
15 15
 class getUpdates extends receiver {
16
-    public static function init () {
16
+    public static function init() {
17 17
         $last_update_id = self::loadData();
18
-        while(true) {
18
+        while (true) {
19 19
             if (!lock::exist('getUpdate')) {
20
-                $updates = telegram::getUpdates($last_update_id,allowed_updates: settings::$allowed_updates);
20
+                $updates = telegram::getUpdates($last_update_id, allowed_updates: settings::$allowed_updates);
21 21
                 if (telegram::$status) {
22 22
                     self::handleUpdates($updates);
23
-                    lock::save('getUpdate',BPT::$update->update_id+1);
24
-                    $last_update_id = BPT::$update->update_id+1;
23
+                    lock::save('getUpdate', BPT::$update->update_id + 1);
24
+                    $last_update_id = BPT::$update->update_id + 1;
25 25
                 }
26 26
                 else {
27
-                    logger::write("There is some problem happened , telegram response : \n".json_encode($updates),loggerTypes::ERROR);
28
-                    BPT::exit(print_r($updates,true));
27
+                    logger::write("There is some problem happened , telegram response : \n".json_encode($updates), loggerTypes::ERROR);
28
+                    BPT::exit(print_r($updates, true));
29 29
                 }
30 30
             }
31 31
         }
32 32
     }
33 33
 
34
-    private static function loadData(): bool|int|string {
34
+    private static function loadData(): bool | int | string {
35 35
         if (lock::exist('getUpdate')) {
36 36
             $last_update_id = lock::read('getUpdate');
37 37
         }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             self::deleteOldLocks();
40 40
             telegram::deleteWebhook();
41 41
             $last_update_id = 0;
42
-            lock::save('getUpdate',0);
42
+            lock::save('getUpdate', 0);
43 43
         }
44 44
         return $last_update_id;
45 45
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
                     self::handleUpdates($updates);
23 23
                     lock::save('getUpdate',BPT::$update->update_id+1);
24 24
                     $last_update_id = BPT::$update->update_id+1;
25
-                }
26
-                else {
25
+                } else {
27 26
                     logger::write("There is some problem happened , telegram response : \n".json_encode($updates),loggerTypes::ERROR);
28 27
                     BPT::exit(print_r($updates,true));
29 28
                 }
@@ -34,8 +33,7 @@  discard block
 block discarded – undo
34 33
     private static function loadData(): bool|int|string {
35 34
         if (lock::exist('getUpdate')) {
36 35
             $last_update_id = lock::read('getUpdate');
37
-        }
38
-        else {
36
+        } else {
39 37
             self::deleteOldLocks();
40 38
             telegram::deleteWebhook();
41 39
             $last_update_id = 0;
Please login to merge, or discard this patch.
receiver/webhook.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 use CURLFile;
13 13
 
14 14
 class webhook extends receiver {
15
-    public static function init () {
15
+    public static function init() {
16 16
         if (settings::$multi) {
17 17
             multi::init();
18 18
         }
@@ -49,23 +49,23 @@  discard block
 block discarded – undo
49 49
     protected static function setWebhook(string $url) {
50 50
         $res = telegram::setWebhook($url, settings::$certificate, max_connections:settings::$max_connection, allowed_updates : settings::$allowed_updates);
51 51
         if (telegram::$status) {
52
-            logger::write('Webhook was set successfully',loggerTypes::INFO);
52
+            logger::write('Webhook was set successfully', loggerTypes::INFO);
53 53
         }
54 54
         else {
55
-            logger::write("There is some problem happened , telegram response : \n".json_encode($res),loggerTypes::ERROR);
56
-            BPT::exit(print_r($res,true));
55
+            logger::write("There is some problem happened , telegram response : \n".json_encode($res), loggerTypes::ERROR);
56
+            BPT::exit(print_r($res, true));
57 57
         }
58 58
     }
59 59
 
60 60
     protected static function checkURL() {
61 61
         if (!(isset($_SERVER['SERVER_NAME']) && isset($_SERVER['REQUEST_URI']))) {
62
-            logger::write('For using webhook receiver , you should open this file in your webserver(by domain)',loggerTypes::ERROR);
62
+            logger::write('For using webhook receiver , you should open this file in your webserver(by domain)', loggerTypes::ERROR);
63 63
             throw new bptException('WEBHOOK_NEED_URL');
64 64
         }
65 65
     }
66 66
 
67 67
     private static function setURL(): string {
68
-        return (isset(settings::$certificate) ? 'http://' : 'https://') . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
68
+        return (isset(settings::$certificate) ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
69 69
     }
70 70
 
71 71
     protected static function setCertificate() {
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,14 +15,12 @@  discard block
 block discarded – undo
15 15
     public static function init () {
16 16
         if (settings::$multi) {
17 17
             multi::init();
18
-        }
19
-        else {
18
+        } else {
20 19
             if (lock::exist('BPT-HOOK')) {
21 20
                 receiver::telegramVerify();
22 21
                 receiver::processUpdate();
23 22
                 logger::write('Update received , lets process it ;)');
24
-            }
25
-            else {
23
+            } else {
26 24
                 self::deleteOldLocks();
27 25
                 self::checkURL();
28 26
                 self::setCertificate();
@@ -50,8 +48,7 @@  discard block
 block discarded – undo
50 48
         $res = telegram::setWebhook($url, settings::$certificate, max_connections:settings::$max_connection, allowed_updates : settings::$allowed_updates);
51 49
         if (telegram::$status) {
52 50
             logger::write('Webhook was set successfully',loggerTypes::INFO);
53
-        }
54
-        else {
51
+        } else {
55 52
             logger::write("There is some problem happened , telegram response : \n".json_encode($res),loggerTypes::ERROR);
56 53
             BPT::exit(print_r($res,true));
57 54
         }
@@ -73,8 +70,7 @@  discard block
 block discarded – undo
73 70
             if (is_string(settings::$certificate)) {
74 71
                 if (file_exists(settings::$certificate)) {
75 72
                     settings::$certificate = new CURLFile(settings::$certificate);
76
-                }
77
-                else {
73
+                } else {
78 74
                     settings::$certificate = null;
79 75
                 }
80 76
             }
Please login to merge, or discard this patch.
receiver/receiver.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,20 +22,20 @@  discard block
 block discarded – undo
22 22
     protected static function telegramVerify(string $ip = null) {
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) {
31
+    protected static function processUpdate(string | stdClass | update $update = null) {
32 32
         if (!is_object($update)) {
33 33
             $update = json_decode($update ?? file_get_contents("php://input"));
34 34
             if (!$update) {
35 35
                 BPT::exit();
36 36
             }
37 37
         }
38
-        elseif (!is_a($update,'update')) {
38
+        elseif (!is_a($update, 'update')) {
39 39
             $update = new update($update);
40 40
         }
41 41
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         self::processHandler();
45 45
     }
46 46
 
47
-    protected static function setMessageExtra (update &$update) {
47
+    protected static function setMessageExtra(update & $update) {
48 48
         if ((isset($update->message) && isset($update->message->text)) || (isset($update->edited_message) && isset($update->edited_message->text))) {
49 49
             $type = isset($update->message) ? 'message' : 'edited_message';
50 50
             $text = &$update->$type->text;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 BPT::$handler->something_else(BPT::$update);
93 93
             }
94 94
             else {
95
-                logger::write('Update received but handlers does not set',loggerTypes::WARNING);
95
+                logger::write('Update received but handlers does not set', loggerTypes::WARNING);
96 96
             }
97 97
         }
98 98
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@  discard block
 block discarded – undo
34 34
             if (!$update) {
35 35
                 BPT::exit();
36 36
             }
37
-        }
38
-        elseif (!is_a($update,'update')) {
37
+        } elseif (!is_a($update,'update')) {
39 38
             $update = new update($update);
40 39
         }
41 40
 
@@ -72,26 +71,21 @@  discard block
 block discarded – undo
72 71
                 if (self::handlerExist('message')) {
73 72
                     BPT::$handler->message(BPT::$update->message);
74 73
                 }
75
-            }
76
-            elseif (isset(BPT::$update->callback_query)) {
74
+            } elseif (isset(BPT::$update->callback_query)) {
77 75
                 if (self::handlerExist('callback_query')) {
78 76
                     BPT::$handler->callback_query(BPT::$update->callback_query);
79 77
                 }
80
-            }
81
-            elseif (isset(BPT::$update->inline_query)) {
78
+            } elseif (isset(BPT::$update->inline_query)) {
82 79
                 if (self::handlerExist('inline_query')) {
83 80
                     BPT::$handler->inline_query(BPT::$update->inline_query);
84 81
                 }
85
-            }
86
-            elseif (isset(BPT::$update->edited_message)) {
82
+            } elseif (isset(BPT::$update->edited_message)) {
87 83
                 if (self::handlerExist('edited_message')) {
88 84
                     BPT::$handler->edited_message(BPT::$update->edited_message);
89 85
                 }
90
-            }
91
-            elseif (self::handlerExist('something_else')) {
86
+            } elseif (self::handlerExist('something_else')) {
92 87
                 BPT::$handler->something_else(BPT::$update);
93
-            }
94
-            else {
88
+            } else {
95 89
                 logger::write('Update received but handlers does not set',loggerTypes::WARNING);
96 90
             }
97 91
         }
Please login to merge, or discard this patch.
tools.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      * @param string $username Your text to be check is username or not e.g. : 'BPT_CH' | '@BPT_CH'
23 23
      * @return bool
24 24
      */
25
-    public static function isUsername (string $username): bool {
25
+    public static function isUsername(string $username): bool {
26 26
         $length = strlen($username);
27 27
         return strpos($username, '__') === false && $length >= 5 && $length <= 33 && preg_match('/^@?([a-zA-Z])(\w{4,31})$/', $username);
28 28
     }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * @param string $range Your range ip for check , if you didn't specify the block , it will be 32
39 39
      * @return bool
40 40
      */
41
-    public static function ipInRange (string $ip, string $range): bool {
41
+    public static function ipInRange(string $ip, string $range): bool {
42 42
         if (!str_contains($range, '/')) {
43 43
             $range .= '/32';
44 44
         }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @param string $ip     Your ip to be check is telegram or not e.g. '192.168.1.1'
58 58
      * @return bool
59 59
      */
60
-    public static function isTelegram (string $ip): bool {
60
+    public static function isTelegram(string $ip): bool {
61 61
         return self::ipInRange($ip, '149.154.160.0/20') || self::ipInRange($ip, '91.108.4.0/22');
62 62
     }
63 63
 
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
      * @param string $ip Your ip to be check is CloudFlare or not e.g. '192.168.1.1'
72 72
      * @return bool
73 73
      */
74
-    public static function isCloudFlare (string $ip): bool {
74
+    public static function isCloudFlare(string $ip): bool {
75 75
         $cf_ips = ['173.245.48.0/20', '103.21.244.0/22', '103.22.200.0/22', '103.31.4.0/22', '141.101.64.0/18', '108.162.192.0/18', '190.93.240.0/20', '188.114.96.0/20', '197.234.240.0/22', '198.41.128.0/17', '162.158.0.0/15', '104.16.0.0/12', '172.64.0.0/13', '131.0.72.0/22'];
76 76
         foreach ($cf_ips as $cf_ip) {
77
-            if (self::ipInRange($ip,$cf_ip)) {
77
+            if (self::ipInRange($ip, $cf_ip)) {
78 78
                 return true;
79 79
             }
80 80
         }
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
      *
98 98
      * @return types\responseError|types\user return array when verify is active and token is true array of telegram getMe result
99 99
      */
100
-    public static function isToken (string $token, bool $verify = false): bool|types\user {
100
+    public static function isToken(string $token, bool $verify = false): bool | types\user {
101 101
         if (preg_match('/^(\d{8,10}):[\w\-]{35}$/', $token)) {
102
-            if ($verify){
102
+            if ($verify) {
103 103
                 $res = telegram::me($token);
104 104
                 if (telegram::$status) {
105 105
                     return $res;
@@ -132,14 +132,14 @@  discard block
 block discarded – undo
132 132
      * @param int|null $user_id e.g. => '442109602'
133 133
      * @return bool
134 134
      */
135
-    public static function isJoined (array|string|int $ids , int|null $user_id = null): bool {
135
+    public static function isJoined(array | string | int $ids, int | null $user_id = null): bool {
136 136
         if (!is_array($ids)) {
137 137
             $ids = [$ids];
138 138
         }
139 139
         //$user_id = $user_id ?? $this->catchFields(['field' => 'user_id']);
140 140
 
141 141
         foreach ($ids as $id) {
142
-            $check = telegram::getChatMember($id,$user_id);
142
+            $check = telegram::getChatMember($id, $user_id);
143 143
             if (telegram::$status) {
144 144
                 $check = $check->status;
145 145
                 return !($check === chatMemberStatus::LEFT || $check === chatMemberStatus::KICKED);
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
      * @param string $characters e.g. => 'abcdefg'
168 168
      * @return string
169 169
      */
170
-    public static function randomString (int $length = 16, string $characters = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'): string {
170
+    public static function randomString(int $length = 16, string $characters = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'): string {
171 171
         $rand_string = '';
172 172
         $char_len = strlen($characters) - 1;
173
-        for ($i = 0; $i < $length; $i ++) {
173
+        for ($i = 0; $i < $length; $i++) {
174 174
             $rand_string .= $characters[rand(0, $char_len)];
175 175
         }
176 176
         return $rand_string;
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
      * @param string $mode Your selected mode e.g. => `parseMode::HTML` | `HTML`
190 190
      * @return string|false return false when mode is incorrect
191 191
      */
192
-    public static function modeEscape (string $text, string $mode = parseMode::HTML): string|false {
192
+    public static function modeEscape(string $text, string $mode = parseMode::HTML): string | false {
193 193
         return match ($mode) {
194
-            parseMode::HTML => str_replace(['&', '<', '>',], ["&amp;", "&lt;", "&gt;",], $text),
195
-            parseMode::MARKDOWN => str_replace(['\\', '_', '*', '`', '['], ['\\\\', '\_', '\*', '\`', '\[',], $text),
194
+            parseMode::HTML => str_replace(['&', '<', '>', ], ["&amp;", "&lt;", "&gt;", ], $text),
195
+            parseMode::MARKDOWN => str_replace(['\\', '_', '*', '`', '['], ['\\\\', '\_', '\*', '\`', '\[', ], $text),
196 196
             parseMode::MARKDOWNV2 => str_replace(
197 197
                 ['_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!', '\\'],
198 198
                 ['\_', '\*', '\[', '\]', '\(', '\)', '\~', '\`', '\>', '\#', '\+', '\-', '\=', '\|', '\{', '\}', '\.', '\!', '\\\\'],
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
      * @param int $precision e.g. => 2
219 219
      * @return string
220 220
      */
221
-    public static function byteFormat (int $byte, int $precision = 2): string {
221
+    public static function byteFormat(int $byte, int $precision = 2): string {
222 222
         $rate_counter = 0;
223 223
 
224
-        while ($byte > 1024){
224
+        while ($byte > 1024) {
225 225
             $byte /= 1024;
226 226
             $rate_counter++;
227 227
         }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             $byte = round($byte, $precision);
231 231
         }
232 232
 
233
-        return $byte . ' ' . ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'][$rate_counter];
233
+        return $byte.' '.['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'][$rate_counter];
234 234
     }
235 235
 
236 236
     /**
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
      * @param bool $format if you set this true , you will receive symbolic string like 2.76MB
251 251
      * @return string|int|false string for formatted data , int for normal data , false when size can not be found(file not found or ...)
252 252
      */
253
-    public static function size (string $path, bool $format = true): string|int|false {
253
+    public static function size(string $path, bool $format = true): string | int | false {
254 254
         if (filter_var($path, FILTER_VALIDATE_URL)) {
255 255
             $ch = curl_init($path);
256 256
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      * @param array $array e.g. => ['path'=>'xfolder/yfolder','sub'=>true]
286 286
      * @return bool
287 287
      */
288
-    public static function delete (string $path, bool $sub = true): bool {
288
+    public static function delete(string $path, bool $sub = true): bool {
289 289
         if (is_dir($path)) {
290 290
             if (count(scandir($path)) > 2) {
291 291
                 if ($sub) {
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                     rmdir($path);
298 298
                 }
299 299
                 else {
300
-                    logger::write("BPT delete function used\ndelete function cannot delete folder because its have subFiles and sub parameter haven't true value",loggerTypes::WARNING);
300
+                    logger::write("BPT delete function used\ndelete function cannot delete folder because its have subFiles and sub parameter haven't true value", loggerTypes::WARNING);
301 301
                     return false;
302 302
                 }
303 303
             }
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
      * @return array
321 321
      * @throws Exception
322 322
      */
323
-    public static function time2string (int $datetime): array {
323
+    public static function time2string(int $datetime): array {
324 324
         $now = new DateTime;
325
-        $input = new DateTime('@' . $datetime);
325
+        $input = new DateTime('@'.$datetime);
326 326
         $status = $now < $input ? 'later' : 'ago';
327 327
         $diff = $now->diff($input);
328 328
         $diff->w = floor($diff->d / 7);
Please login to merge, or discard this patch.
api/request.php 2 patches
Spacing   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -452,94 +452,94 @@  discard block
 block discarded – undo
452 452
     ];
453 453
 
454 454
     private const METHODS_KEYS = [
455
-        'getUpdates'                      => ['offset','limit','timeout','allowed_updates','token','return_array','forgot','answer'],
456
-        'setWebhook'                      => ['url','certificate','ip_address','max_connections','allowed_updates','drop_pending_updates','secret_token','token','return_array','forgot','answer'],
457
-        'deleteWebhook'                   => ['drop_pending_updates','token','return_array','forgot','answer'],
458
-        'getWebhookInfo'                  => ['token','return_array','forgot','answer'],
459
-        'getMe'                           => ['token','return_array','forgot','answer'],
460
-        'logOut'                          => ['token','return_array','forgot','answer'],
461
-        'close'                           => ['token','return_array','forgot','answer'],
462
-        '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'],
463
-        'forwardMessage'                  => ['chat_id','from_chat_id','disable_notification','protect_content','message_id','token','return_array','forgot','answer'],
464
-        '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'],
465
-        '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'],
466
-        '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'],
467
-        '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'],
468
-        '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'],
469
-        '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'],
470
-        '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'],
471
-        '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'],
472
-        'sendMediaGroup'                  => ['media','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','token','return_array','forgot','answer'],
473
-        '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'],
474
-        'editMessageLiveLocation'         => ['latitude','longitude','chat_id','message_id','inline_message_id','horizontal_accuracy','heading','proximity_alert_radius','reply_markup','token','return_array','forgot','answer'],
475
-        'stopMessageLiveLocation'         => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'],
476
-        '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'],
477
-        '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'],
478
-        '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'],
479
-        'sendDice'                        => ['chat_id','emoji','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'],
480
-        'sendChatAction'                  => ['chat_id','action','token','return_array','forgot','answer'],
481
-        'getUserProfilePhotos'            => ['user_id','offset','limit','token','return_array','forgot','answer'],
482
-        'getFile'                         => ['file_id','token','return_array','forgot','answer'],
483
-        'banChatMember'                   => ['chat_id','user_id','until_date','revoke_messages','token','return_array','forgot','answer'],
484
-        'unbanChatMember'                 => ['chat_id','user_id','only_if_banned','token','return_array','forgot','answer'],
485
-        'restrictChatMember'              => ['permissions','chat_id','user_id','until_date','token','return_array','forgot','answer'],
486
-        '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'],
487
-        'setChatAdministratorCustomTitle' => ['custom_title','chat_id','user_id','token','return_array','forgot','answer'],
488
-        'banChatSenderChat'               => ['sender_chat_id','chat_id','token','return_array','forgot','answer'],
489
-        'unbanChatSenderChat'             => ['sender_chat_id','chat_id','token','return_array','forgot','answer'],
490
-        'setChatPermissions'              => ['permissions','chat_id','token','return_array','forgot','answer'],
491
-        'exportChatInviteLink'            => ['chat_id','token','return_array','forgot','answer'],
492
-        'createChatInviteLink'            => ['chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'],
493
-        'editChatInviteLink'              => ['invite_link','chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'],
494
-        'revokeChatInviteLink'            => ['invite_link','chat_id','token','return_array','forgot','answer'],
495
-        'approveChatJoinRequest'          => ['chat_id','user_id','token','return_array','forgot','answer'],
496
-        'declineChatJoinRequest'          => ['chat_id','user_id','token','return_array','forgot','answer'],
497
-        'setChatPhoto'                    => ['photo','chat_id','token','return_array','forgot','answer'],
498
-        'deleteChatPhoto'                 => ['chat_id','token','return_array','forgot','answer'],
499
-        'setChatTitle'                    => ['title','chat_id','token','return_array','forgot','answer'],
500
-        'setChatDescription'              => ['chat_id','description','token','return_array','forgot','answer'],
501
-        'pinChatMessage'                  => ['message_id','chat_id','disable_notification','token','return_array','forgot','answer'],
502
-        'unpinChatMessage'                => ['chat_id','message_id','token','return_array','forgot','answer'],
503
-        'unpinAllChatMessages'            => ['chat_id','token','return_array','forgot','answer'],
504
-        'leaveChat'                       => ['chat_id','token','return_array','forgot','answer'],
505
-        'getChat'                         => ['chat_id','token','return_array','forgot','answer'],
506
-        'getChatAdministrators'           => ['chat_id','token','return_array','forgot','answer'],
507
-        'getChatMemberCount'              => ['chat_id','token','return_array','forgot','answer'],
508
-        'getChatMember'                   => ['chat_id','user_id','token','return_array','forgot','answer'],
509
-        'setChatStickerSet'               => ['sticker_set_name','chat_id','token','return_array','forgot','answer'],
510
-        'deleteChatStickerSet'            => ['chat_id','token','return_array','forgot','answer'],
511
-        'answerCallbackQuery'             => ['callback_query_id','text','show_alert','url','cache_time','token','return_array','forgot','answer'],
512
-        'setMyCommands'                   => ['commands','scope','language_code','token','return_array','forgot','answer'],
513
-        'deleteMyCommands'                => ['scope','language_code','token','return_array','forgot','answer'],
514
-        'getMyCommands'                   => ['scope','language_code','token','return_array','forgot','answer'],
515
-        'setChatMenuButton'               => ['chat_id','menu_button','token','return_array','forgot','answer'],
516
-        'getChatMenuButton'               => ['chat_id','token','return_array','forgot','answer'],
517
-        'setMyDefaultAdministratorRights' => ['rights','for_channels','token','return_array','forgot','answer'],
518
-        'getMyDefaultAdministratorRights' => ['for_channels','token','return_array','forgot','answer'],
519
-        'editMessageText'                 => ['text','chat_id','message_id','inline_message_id','parse_mode','entities','disable_web_page_preview','reply_markup','token','return_array','forgot','answer'],
520
-        'editMessageCaption'              => ['chat_id','message_id','inline_message_id','caption','parse_mode','caption_entities','reply_markup','token','return_array','forgot','answer'],
521
-        'editMessageMedia'                => ['media','chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'],
522
-        'editMessageReplyMarkup'          => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'],
523
-        'stopPoll'                        => ['chat_id','message_id','reply_markup','token','return_array','forgot','answer'],
524
-        'deleteMessage'                   => ['chat_id','message_id','token','return_array','forgot','answer'],
525
-        'sendSticker'                     => ['sticker','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'],
526
-        'getStickerSet'                   => ['name','token','return_array','forgot','answer'],
527
-        'uploadStickerFile'               => ['png_sticker','user_id','token','return_array','forgot','answer'],
528
-        'createNewStickerSet'             => ['name','title','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','contains_masks','mask_position','token','return_array','forgot','answer'],
529
-        'addStickerToSet'                 => ['name','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','mask_position','token','return_array','forgot','answer'],
530
-        'setStickerPositionInSet'         => ['sticker','position','token','return_array','forgot','answer'],
531
-        'deleteStickerFromSet'            => ['sticker','token','return_array','forgot','answer'],
532
-        'setStickerSetThumb'              => ['name','user_id','thumb','token','return_array','forgot','answer'],
533
-        'answerInlineQuery'               => ['results','inline_query_id','cache_time','is_personal','next_offset','switch_pm_text','switch_pm_parameter','token','return_array','forgot','answer'],
534
-        'answerWebAppQuery'               => ['web_app_query_id','result','token','return_array','forgot','answer'],
535
-        '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'],
536
-        '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'],
537
-        'answerShippingQuery'             => ['ok','shipping_query_id','shipping_options','error_message','token','return_array','forgot','answer'],
538
-        'answerPreCheckoutQuery'          => ['ok','pre_checkout_query_id','error_message','token','return_array','forgot','answer'],
539
-        'setPassportDataErrors'           => ['errors','user_id','token','return_array','forgot','answer'],
540
-        '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'],
541
-        'setGameScore'                    => ['score','user_id','force','disable_edit_message','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'],
542
-        'getGameHighScores'               => ['user_id','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'],
455
+        'getUpdates'                      => ['offset', 'limit', 'timeout', 'allowed_updates', 'token', 'return_array', 'forgot', 'answer'],
456
+        'setWebhook'                      => ['url', 'certificate', 'ip_address', 'max_connections', 'allowed_updates', 'drop_pending_updates', 'secret_token', 'token', 'return_array', 'forgot', 'answer'],
457
+        'deleteWebhook'                   => ['drop_pending_updates', 'token', 'return_array', 'forgot', 'answer'],
458
+        'getWebhookInfo'                  => ['token', 'return_array', 'forgot', 'answer'],
459
+        'getMe'                           => ['token', 'return_array', 'forgot', 'answer'],
460
+        'logOut'                          => ['token', 'return_array', 'forgot', 'answer'],
461
+        'close'                           => ['token', 'return_array', 'forgot', 'answer'],
462
+        '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'],
463
+        'forwardMessage'                  => ['chat_id', 'from_chat_id', 'disable_notification', 'protect_content', 'message_id', 'token', 'return_array', 'forgot', 'answer'],
464
+        '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'],
465
+        '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'],
466
+        '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'],
467
+        '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'],
468
+        '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'],
469
+        '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'],
470
+        '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'],
471
+        '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'],
472
+        'sendMediaGroup'                  => ['media', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'token', 'return_array', 'forgot', 'answer'],
473
+        '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'],
474
+        'editMessageLiveLocation'         => ['latitude', 'longitude', 'chat_id', 'message_id', 'inline_message_id', 'horizontal_accuracy', 'heading', 'proximity_alert_radius', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'],
475
+        'stopMessageLiveLocation'         => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'],
476
+        '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'],
477
+        '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'],
478
+        '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'],
479
+        'sendDice'                        => ['chat_id', 'emoji', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'],
480
+        'sendChatAction'                  => ['chat_id', 'action', 'token', 'return_array', 'forgot', 'answer'],
481
+        'getUserProfilePhotos'            => ['user_id', 'offset', 'limit', 'token', 'return_array', 'forgot', 'answer'],
482
+        'getFile'                         => ['file_id', 'token', 'return_array', 'forgot', 'answer'],
483
+        'banChatMember'                   => ['chat_id', 'user_id', 'until_date', 'revoke_messages', 'token', 'return_array', 'forgot', 'answer'],
484
+        'unbanChatMember'                 => ['chat_id', 'user_id', 'only_if_banned', 'token', 'return_array', 'forgot', 'answer'],
485
+        'restrictChatMember'              => ['permissions', 'chat_id', 'user_id', 'until_date', 'token', 'return_array', 'forgot', 'answer'],
486
+        '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'],
487
+        'setChatAdministratorCustomTitle' => ['custom_title', 'chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'],
488
+        'banChatSenderChat'               => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'],
489
+        'unbanChatSenderChat'             => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'],
490
+        'setChatPermissions'              => ['permissions', 'chat_id', 'token', 'return_array', 'forgot', 'answer'],
491
+        'exportChatInviteLink'            => ['chat_id', 'token', 'return_array', 'forgot', 'answer'],
492
+        'createChatInviteLink'            => ['chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'],
493
+        'editChatInviteLink'              => ['invite_link', 'chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'],
494
+        'revokeChatInviteLink'            => ['invite_link', 'chat_id', 'token', 'return_array', 'forgot', 'answer'],
495
+        'approveChatJoinRequest'          => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'],
496
+        'declineChatJoinRequest'          => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'],
497
+        'setChatPhoto'                    => ['photo', 'chat_id', 'token', 'return_array', 'forgot', 'answer'],
498
+        'deleteChatPhoto'                 => ['chat_id', 'token', 'return_array', 'forgot', 'answer'],
499
+        'setChatTitle'                    => ['title', 'chat_id', 'token', 'return_array', 'forgot', 'answer'],
500
+        'setChatDescription'              => ['chat_id', 'description', 'token', 'return_array', 'forgot', 'answer'],
501
+        'pinChatMessage'                  => ['message_id', 'chat_id', 'disable_notification', 'token', 'return_array', 'forgot', 'answer'],
502
+        'unpinChatMessage'                => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'],
503
+        'unpinAllChatMessages'            => ['chat_id', 'token', 'return_array', 'forgot', 'answer'],
504
+        'leaveChat'                       => ['chat_id', 'token', 'return_array', 'forgot', 'answer'],
505
+        'getChat'                         => ['chat_id', 'token', 'return_array', 'forgot', 'answer'],
506
+        'getChatAdministrators'           => ['chat_id', 'token', 'return_array', 'forgot', 'answer'],
507
+        'getChatMemberCount'              => ['chat_id', 'token', 'return_array', 'forgot', 'answer'],
508
+        'getChatMember'                   => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'],
509
+        'setChatStickerSet'               => ['sticker_set_name', 'chat_id', 'token', 'return_array', 'forgot', 'answer'],
510
+        'deleteChatStickerSet'            => ['chat_id', 'token', 'return_array', 'forgot', 'answer'],
511
+        'answerCallbackQuery'             => ['callback_query_id', 'text', 'show_alert', 'url', 'cache_time', 'token', 'return_array', 'forgot', 'answer'],
512
+        'setMyCommands'                   => ['commands', 'scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'],
513
+        'deleteMyCommands'                => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'],
514
+        'getMyCommands'                   => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'],
515
+        'setChatMenuButton'               => ['chat_id', 'menu_button', 'token', 'return_array', 'forgot', 'answer'],
516
+        'getChatMenuButton'               => ['chat_id', 'token', 'return_array', 'forgot', 'answer'],
517
+        'setMyDefaultAdministratorRights' => ['rights', 'for_channels', 'token', 'return_array', 'forgot', 'answer'],
518
+        'getMyDefaultAdministratorRights' => ['for_channels', 'token', 'return_array', 'forgot', 'answer'],
519
+        'editMessageText'                 => ['text', 'chat_id', 'message_id', 'inline_message_id', 'parse_mode', 'entities', 'disable_web_page_preview', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'],
520
+        'editMessageCaption'              => ['chat_id', 'message_id', 'inline_message_id', 'caption', 'parse_mode', 'caption_entities', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'],
521
+        'editMessageMedia'                => ['media', 'chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'],
522
+        'editMessageReplyMarkup'          => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'],
523
+        'stopPoll'                        => ['chat_id', 'message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'],
524
+        'deleteMessage'                   => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'],
525
+        'sendSticker'                     => ['sticker', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'],
526
+        'getStickerSet'                   => ['name', 'token', 'return_array', 'forgot', 'answer'],
527
+        'uploadStickerFile'               => ['png_sticker', 'user_id', 'token', 'return_array', 'forgot', 'answer'],
528
+        'createNewStickerSet'             => ['name', 'title', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'contains_masks', 'mask_position', 'token', 'return_array', 'forgot', 'answer'],
529
+        'addStickerToSet'                 => ['name', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'mask_position', 'token', 'return_array', 'forgot', 'answer'],
530
+        'setStickerPositionInSet'         => ['sticker', 'position', 'token', 'return_array', 'forgot', 'answer'],
531
+        'deleteStickerFromSet'            => ['sticker', 'token', 'return_array', 'forgot', 'answer'],
532
+        'setStickerSetThumb'              => ['name', 'user_id', 'thumb', 'token', 'return_array', 'forgot', 'answer'],
533
+        'answerInlineQuery'               => ['results', 'inline_query_id', 'cache_time', 'is_personal', 'next_offset', 'switch_pm_text', 'switch_pm_parameter', 'token', 'return_array', 'forgot', 'answer'],
534
+        'answerWebAppQuery'               => ['web_app_query_id', 'result', 'token', 'return_array', 'forgot', 'answer'],
535
+        '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'],
536
+        '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'],
537
+        'answerShippingQuery'             => ['ok', 'shipping_query_id', 'shipping_options', 'error_message', 'token', 'return_array', 'forgot', 'answer'],
538
+        'answerPreCheckoutQuery'          => ['ok', 'pre_checkout_query_id', 'error_message', 'token', 'return_array', 'forgot', 'answer'],
539
+        'setPassportDataErrors'           => ['errors', 'user_id', 'token', 'return_array', 'forgot', 'answer'],
540
+        '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'],
541
+        'setGameScore'                    => ['score', 'user_id', 'force', 'disable_edit_message', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'],
542
+        'getGameHighScores'               => ['user_id', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'],
543 543
     ];
544 544
 
545 545
     private const METHODS_WITH_FILE = [
@@ -568,8 +568,8 @@  discard block
 block discarded – undo
568 568
         'logOut'                          => [],
569 569
         'close'                           => [],
570 570
         'sendMessage'                     => ['chat_id'],
571
-        'forwardMessage'                  => ['from_chat_id','message_id'],
572
-        'copyMessage'                     => ['from_chat_id','message_id'],
571
+        'forwardMessage'                  => ['from_chat_id', 'message_id'],
572
+        'copyMessage'                     => ['from_chat_id', 'message_id'],
573 573
         'sendPhoto'                       => ['chat_id'],
574 574
         'sendAudio'                       => ['chat_id'],
575 575
         'sendDocument'                    => ['chat_id'],
@@ -585,15 +585,15 @@  discard block
 block discarded – undo
585 585
         'sendContact'                     => ['chat_id'],
586 586
         'sendPoll'                        => ['chat_id'],
587 587
         'sendDice'                        => ['chat_id'],
588
-        'sendChatAction'                  => ['chat_id','action'],
588
+        'sendChatAction'                  => ['chat_id', 'action'],
589 589
         'getUserProfilePhotos'            => ['user_id'],
590 590
         'getFile'                         => ['file_id'],
591
-        'banChatMember'                   => ['chat_id','user_id'],
592
-        'kickChatMember'                  => ['chat_id','user_id'],
593
-        'unbanChatMember'                 => ['chat_id','user_id'],
594
-        'restrictChatMember'              => ['chat_id','user_id'],
595
-        'promoteChatMember'               => ['chat_id','user_id'],
596
-        'setChatAdministratorCustomTitle' => ['chat_id','user_id'],
591
+        'banChatMember'                   => ['chat_id', 'user_id'],
592
+        'kickChatMember'                  => ['chat_id', 'user_id'],
593
+        'unbanChatMember'                 => ['chat_id', 'user_id'],
594
+        'restrictChatMember'              => ['chat_id', 'user_id'],
595
+        'promoteChatMember'               => ['chat_id', 'user_id'],
596
+        'setChatAdministratorCustomTitle' => ['chat_id', 'user_id'],
597 597
         'banChatSenderChat'               => ['chat_id'],
598 598
         'unbanChatSenderChat'             => ['chat_id'],
599 599
         'setChatPermissions'              => ['chat_id'],
@@ -601,8 +601,8 @@  discard block
 block discarded – undo
601 601
         'createChatInviteLink'            => ['chat_id'],
602 602
         'editChatInviteLink'              => ['chat_id'],
603 603
         'revokeChatInviteLink'            => ['chat_id'],
604
-        'approveChatJoinRequest'          => ['chat_id','user_id'],
605
-        'declineChatJoinRequest'          => ['chat_id','user_id'],
604
+        'approveChatJoinRequest'          => ['chat_id', 'user_id'],
605
+        'declineChatJoinRequest'          => ['chat_id', 'user_id'],
606 606
         'setChatPhoto'                    => ['chat_id'],
607 607
         'deleteChatPhoto'                 => ['chat_id'],
608 608
         'setChatTitle'                    => ['chat_id'],
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
         'getChat'                         => ['chat_id'],
615 615
         'getChatAdministrators'           => ['chat_id'],
616 616
         'getChatMembersCount'             => ['chat_id'],
617
-        'getChatMember'                   => ['chat_id','user_id'],
617
+        'getChatMember'                   => ['chat_id', 'user_id'],
618 618
         'setChatStickerSet'               => ['chat_id'],
619 619
         'deleteChatStickerSet'            => ['chat_id'],
620 620
         'answerCallbackQuery'             => ['callback_query_id'],
@@ -625,12 +625,12 @@  discard block
 block discarded – undo
625 625
         'getChatMenuButton'               => [],
626 626
         'setMyDefaultAdministratorRights' => [],
627 627
         'getMyDefaultAdministratorRights' => [],
628
-        'editMessageText'                 => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
629
-        'editMessageCaption'              => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
630
-        'editMessageMedia'                => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
631
-        'editMessageReplyMarkup'          => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
632
-        'stopPoll'                        => ['chat_id','message_id'],
633
-        'deleteMessage'                   => ['chat_id','message_id'],
628
+        'editMessageText'                 => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
629
+        'editMessageCaption'              => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
630
+        'editMessageMedia'                => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
631
+        'editMessageReplyMarkup'          => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
632
+        'stopPoll'                        => ['chat_id', 'message_id'],
633
+        'deleteMessage'                   => ['chat_id', 'message_id'],
634 634
         'sendSticker'                     => ['chat_id'],
635 635
         'getStickerSet'                   => [],
636 636
         'uploadStickerFile'               => ['user_id'],
@@ -646,8 +646,8 @@  discard block
 block discarded – undo
646 646
         'answerPreCheckoutQuery'          => ['pre_checkout_query_id'],
647 647
         'setPassportDataErrors'           => ['user_id'],
648 648
         'sendGame'                        => ['chat_id'],
649
-        'setGameScore'                    => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']],
650
-        'getGameHighScores'               => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']]
649
+        'setGameScore'                    => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']],
650
+        'getGameHighScores'               => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']]
651 651
     ];
652 652
     
653 653
     private const METHODS_RETURN = [
@@ -699,25 +699,25 @@  discard block
 block discarded – undo
699 699
     ];
700 700
 
701 701
 
702
-    public static function __callStatic (string $name, array $arguments) {
702
+    public static function __callStatic(string $name, array $arguments) {
703 703
         if ($action = self::methodAction($name)) {
704
-            self::keysName($action,$arguments);
705
-            self::readyFile($action,$arguments);
706
-            self::setDefaults($action,$arguments);
704
+            self::keysName($action, $arguments);
705
+            self::readyFile($action, $arguments);
706
+            self::setDefaults($action, $arguments);
707 707
             if (isset($arguments['answer'])) {
708
-                return answer::init($action,$arguments);
708
+                return answer::init($action, $arguments);
709 709
             }
710 710
             else {
711
-                return self::processResponse($action,curl::init($action,$arguments));
711
+                return self::processResponse($action, curl::init($action, $arguments));
712 712
             }
713 713
         }
714 714
         else {
715
-            logger::write("$name method is not supported",loggerTypes::ERROR);
715
+            logger::write("$name method is not supported", loggerTypes::ERROR);
716 716
             throw new bptException('METHOD_NOT_FOUND');
717 717
         }
718 718
     }
719 719
 
720
-    private static function keysName (string $name, array &$arguments) {
720
+    private static function keysName(string $name, array &$arguments) {
721 721
         foreach ($arguments as $key => $argument) {
722 722
             if (is_numeric($key) && isset(self::METHODS_KEYS[$name][$key])) {
723 723
                 $arguments[self::METHODS_KEYS[$name][$key]] = $argument;
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
         }
727 727
     }
728 728
 
729
-    private static function methodAction(string $name): string|false {
729
+    private static function methodAction(string $name): string | false {
730 730
         return self::METHODS_ACTION[str_replace('_', '', strtolower($name))] ?? false;
731 731
     }
732 732
 
@@ -747,11 +747,11 @@  discard block
 block discarded – undo
747 747
         }
748 748
     }
749 749
 
750
-    private static function methodFile(string $name): array|false {
750
+    private static function methodFile(string $name): array | false {
751 751
         return self::METHODS_WITH_FILE[$name] ?? false;
752 752
     }
753 753
 
754
-    private static function methodReturn(string $name,stdClass $response) {
754
+    private static function methodReturn(string $name, stdClass $response) {
755 755
         if (isset(self::METHODS_RETURN[$name])) {
756 756
             $return = self::METHODS_RETURN[$name];
757 757
             if (is_array($return)) {
@@ -774,13 +774,13 @@  discard block
 block discarded – undo
774 774
         $defaults = self::METHODS_EXTRA_DEFAULTS[$name];
775 775
         foreach ($defaults as $key => $default) {
776 776
             if (is_numeric($key)) {
777
-                if (!isset($arguments[$default])){
777
+                if (!isset($arguments[$default])) {
778 778
                     $arguments[$default] = self::catchFields($default);
779 779
                 }
780 780
             }
781 781
             elseif (isset(BPT::$update->$key) || $key === 'other') {
782 782
                 foreach ($default as $def) {
783
-                    if (!isset($arguments[$def])){
783
+                    if (!isset($arguments[$def])) {
784 784
                         $arguments[$def] = self::catchFields($def);
785 785
                     }
786 786
                 }
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
         if ($response->ok) {
794 794
             self::$status = true;
795 795
             self::$pure_response = $response;
796
-            return self::methodReturn($name,$response);
796
+            return self::methodReturn($name, $response);
797 797
         }
798 798
         else {
799 799
             self::$status = false;
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
         }
803 803
     }
804 804
 
805
-    public static function catchFields (string $field): int|string|bool {
805
+    public static function catchFields(string $field): int | string | bool {
806 806
         switch ($field) {
807 807
             case 'chat_id' :
808 808
             case 'from_chat_id' :
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
                     default => false
939 939
                 };
940 940
             case 'url' :
941
-                return 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
941
+                return 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
942 942
             default:
943 943
                 return false;
944 944
         }
Please login to merge, or discard this patch.
Braces   +14 added lines, -17 removed lines patch added patch discarded remove patch
@@ -706,12 +706,10 @@  discard block
 block discarded – undo
706 706
             self::setDefaults($action,$arguments);
707 707
             if (isset($arguments['answer'])) {
708 708
                 return answer::init($action,$arguments);
709
-            }
710
-            else {
709
+            } else {
711 710
                 return self::processResponse($action,curl::init($action,$arguments));
712 711
             }
713
-        }
714
-        else {
712
+        } else {
715 713
             logger::write("$name method is not supported",loggerTypes::ERROR);
716 714
             throw new bptException('METHOD_NOT_FOUND');
717 715
         }
@@ -737,8 +735,7 @@  discard block
 block discarded – undo
737 735
                     $arguments['media'][$key]['media'] = new CURLFile($media['media']);
738 736
                 }
739 737
             }
740
-        }
741
-        elseif ($file_params = self::methodFile($name)) {
738
+        } elseif ($file_params = self::methodFile($name)) {
742 739
             foreach ($file_params as $param) {
743 740
                 if (isset($arguments[$param]) && file_exists($arguments[$param])) {
744 741
                     $arguments[$param] = new CURLFile($arguments[$param]);
@@ -760,12 +757,10 @@  discard block
 block discarded – undo
760 757
                     $value = new ($return[0]) ($value);
761 758
                 }
762 759
                 return $response;
763
-            }
764
-            else {
760
+            } else {
765 761
                 return new ($return) ($response->result);
766 762
             }
767
-        }
768
-        else {
763
+        } else {
769 764
             return $response->result;
770 765
         }
771 766
     }
@@ -777,8 +772,7 @@  discard block
 block discarded – undo
777 772
                 if (!isset($arguments[$default])){
778 773
                     $arguments[$default] = self::catchFields($default);
779 774
                 }
780
-            }
781
-            elseif (isset(BPT::$update->$key) || $key === 'other') {
775
+            } elseif (isset(BPT::$update->$key) || $key === 'other') {
782 776
                 foreach ($default as $def) {
783 777
                     if (!isset($arguments[$def])){
784 778
                         $arguments[$def] = self::catchFields($def);
@@ -794,8 +788,7 @@  discard block
 block discarded – undo
794 788
             self::$status = true;
795 789
             self::$pure_response = $response;
796 790
             return self::methodReturn($name,$response);
797
-        }
798
-        else {
791
+        } else {
799 792
             self::$status = false;
800 793
             self::$pure_response = $response;
801 794
             return new responseError($response);
@@ -831,9 +824,13 @@  discard block
 block discarded – undo
831 824
                     default => false
832 825
                 };
833 826
             case 'file_id' :
834
-                if (isset(BPT::$update->message)) $type = 'message';
835
-                elseif (isset(BPT::$update->edited_message)) $type = 'edited_message';
836
-                else return false;
827
+                if (isset(BPT::$update->message)) {
828
+                    $type = 'message';
829
+                } elseif (isset(BPT::$update->edited_message)) {
830
+                    $type = 'edited_message';
831
+                } else {
832
+                    return false;
833
+                }
837 834
 
838 835
                 return match(true) {
839 836
                     isset(BPT::$update->$type->animation) => BPT::$update->$type->animation->file_id,
Please login to merge, or discard this patch.
types/chatMemberRestricted.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     public int $until_date;
49 49
 
50 50
 
51
-    public function __construct(stdClass|null $object = null) {
51
+    public function __construct(stdClass | null $object = null) {
52 52
         if ($object != null) {
53 53
             parent::__construct($object, self::subs);
54 54
         }
Please login to merge, or discard this patch.
types/videoNote.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     public int $file_size;
34 34
 
35 35
 
36
-    public function __construct(stdClass|null $object = null) {
36
+    public function __construct(stdClass | null $object = null) {
37 37
         if ($object != null) {
38 38
             parent::__construct($object, self::subs);
39 39
         }
Please login to merge, or discard this patch.
types/loginUrl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     public bool $request_write_access;
42 42
 
43 43
 
44
-    public function __construct(stdClass|null $object = null) {
44
+    public function __construct(stdClass | null $object = null) {
45 45
         if ($object != null) {
46 46
             parent::__construct($object, self::subs);
47 47
         }
Please login to merge, or discard this patch.
types/chatJoinRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     public chatInviteLink $invite_link;
32 32
 
33 33
 
34
-    public function __construct(stdClass|null $object = null) {
34
+    public function __construct(stdClass | null $object = null) {
35 35
         if ($object != null) {
36 36
             parent::__construct($object, self::subs);
37 37
         }
Please login to merge, or discard this patch.