@@ -8,17 +8,17 @@ |
||
8 | 8 | * Contains information about an inline message sent by a Web App on behalf of a user. |
9 | 9 | */ |
10 | 10 | class sentWebAppMessage extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | 13 | |
14 | - /** |
|
15 | - * Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the |
|
16 | - * message. |
|
17 | - */ |
|
18 | - public string $inline_message_id; |
|
14 | + /** |
|
15 | + * Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the |
|
16 | + * message. |
|
17 | + */ |
|
18 | + public string $inline_message_id; |
|
19 | 19 | |
20 | 20 | |
21 | - public function __construct(stdClass $update) { |
|
22 | - parent::__construct($update, self::subs); |
|
23 | - } |
|
21 | + public function __construct(stdClass $update) { |
|
22 | + parent::__construct($update, self::subs); |
|
23 | + } |
|
24 | 24 | } |
@@ -9,39 +9,39 @@ |
||
9 | 9 | * examples). |
10 | 10 | */ |
11 | 11 | class replyKeyboardMarkup extends types { |
12 | - /** Keep all of properties which has sub properties */ |
|
13 | - private const subs = []; |
|
14 | - |
|
15 | - /** Array of button rows, each represented by an Array of KeyboardButton objects */ |
|
16 | - public array $keyboard; |
|
17 | - |
|
18 | - /** |
|
19 | - * Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller |
|
20 | - * if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the |
|
21 | - * same height as the app's standard keyboard. |
|
22 | - */ |
|
23 | - public bool $resize_keyboard; |
|
24 | - |
|
25 | - /** |
|
26 | - * Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be |
|
27 | - * available, but clients will automatically display the usual letter-keyboard in the chat – the user can press |
|
28 | - * a special button in the input field to see the custom keyboard again. Defaults to false. |
|
29 | - */ |
|
30 | - public bool $one_time_keyboard; |
|
31 | - |
|
32 | - /** Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */ |
|
33 | - public string $input_field_placeholder; |
|
34 | - |
|
35 | - /** |
|
36 | - * Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that |
|
37 | - * are mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), |
|
38 | - * sender of the original message.Example: A user requests to change the bot's language, bot replies to the |
|
39 | - * request with a keyboard to select the new language. Other users in the group don't see the keyboard. |
|
40 | - */ |
|
41 | - public bool $selective; |
|
42 | - |
|
43 | - |
|
44 | - public function __construct(stdClass $update) { |
|
45 | - parent::__construct($update, self::subs); |
|
46 | - } |
|
12 | + /** Keep all of properties which has sub properties */ |
|
13 | + private const subs = []; |
|
14 | + |
|
15 | + /** Array of button rows, each represented by an Array of KeyboardButton objects */ |
|
16 | + public array $keyboard; |
|
17 | + |
|
18 | + /** |
|
19 | + * Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller |
|
20 | + * if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the |
|
21 | + * same height as the app's standard keyboard. |
|
22 | + */ |
|
23 | + public bool $resize_keyboard; |
|
24 | + |
|
25 | + /** |
|
26 | + * Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be |
|
27 | + * available, but clients will automatically display the usual letter-keyboard in the chat – the user can press |
|
28 | + * a special button in the input field to see the custom keyboard again. Defaults to false. |
|
29 | + */ |
|
30 | + public bool $one_time_keyboard; |
|
31 | + |
|
32 | + /** Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */ |
|
33 | + public string $input_field_placeholder; |
|
34 | + |
|
35 | + /** |
|
36 | + * Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that |
|
37 | + * are mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), |
|
38 | + * sender of the original message.Example: A user requests to change the bot's language, bot replies to the |
|
39 | + * request with a keyboard to select the new language. Other users in the group don't see the keyboard. |
|
40 | + */ |
|
41 | + public bool $selective; |
|
42 | + |
|
43 | + |
|
44 | + public function __construct(stdClass $update) { |
|
45 | + parent::__construct($update, self::subs); |
|
46 | + } |
|
47 | 47 | } |
@@ -8,56 +8,56 @@ |
||
8 | 8 | * This object contains information about a poll. |
9 | 9 | */ |
10 | 10 | class poll extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | 13 | |
14 | - /** Unique poll identifier */ |
|
15 | - public string $id; |
|
14 | + /** Unique poll identifier */ |
|
15 | + public string $id; |
|
16 | 16 | |
17 | - /** Poll question, 1-300 characters */ |
|
18 | - public string $question; |
|
17 | + /** Poll question, 1-300 characters */ |
|
18 | + public string $question; |
|
19 | 19 | |
20 | - /** List of poll options */ |
|
21 | - public array $options; |
|
20 | + /** List of poll options */ |
|
21 | + public array $options; |
|
22 | 22 | |
23 | - /** Total number of users that voted in the poll */ |
|
24 | - public int $total_voter_count; |
|
23 | + /** Total number of users that voted in the poll */ |
|
24 | + public int $total_voter_count; |
|
25 | 25 | |
26 | - /** True, if the poll is closed */ |
|
27 | - public bool $is_closed; |
|
26 | + /** True, if the poll is closed */ |
|
27 | + public bool $is_closed; |
|
28 | 28 | |
29 | - /** True, if the poll is anonymous */ |
|
30 | - public bool $is_anonymous; |
|
29 | + /** True, if the poll is anonymous */ |
|
30 | + public bool $is_anonymous; |
|
31 | 31 | |
32 | - /** Poll type, currently can be “regular” or “quiz” */ |
|
33 | - public string $type; |
|
32 | + /** Poll type, currently can be “regular” or “quiz” */ |
|
33 | + public string $type; |
|
34 | 34 | |
35 | - /** True, if the poll allows multiple answers */ |
|
36 | - public bool $allows_multiple_answers; |
|
35 | + /** True, if the poll allows multiple answers */ |
|
36 | + public bool $allows_multiple_answers; |
|
37 | 37 | |
38 | - /** |
|
39 | - * Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which |
|
40 | - * are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. |
|
41 | - */ |
|
42 | - public int $correct_option_id; |
|
38 | + /** |
|
39 | + * Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which |
|
40 | + * are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. |
|
41 | + */ |
|
42 | + public int $correct_option_id; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style |
|
46 | - * poll, 0-200 characters |
|
47 | - */ |
|
48 | - public string $explanation; |
|
44 | + /** |
|
45 | + * Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style |
|
46 | + * poll, 0-200 characters |
|
47 | + */ |
|
48 | + public string $explanation; |
|
49 | 49 | |
50 | - /** Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */ |
|
51 | - public array $explanation_entities; |
|
50 | + /** Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */ |
|
51 | + public array $explanation_entities; |
|
52 | 52 | |
53 | - /** Optional. Amount of time in seconds the poll will be active after creation */ |
|
54 | - public int $open_period; |
|
53 | + /** Optional. Amount of time in seconds the poll will be active after creation */ |
|
54 | + public int $open_period; |
|
55 | 55 | |
56 | - /** Optional. Point in time (Unix timestamp) when the poll will be automatically closed */ |
|
57 | - public int $close_date; |
|
56 | + /** Optional. Point in time (Unix timestamp) when the poll will be automatically closed */ |
|
57 | + public int $close_date; |
|
58 | 58 | |
59 | 59 | |
60 | - public function __construct(stdClass $update) { |
|
61 | - parent::__construct($update, self::subs); |
|
62 | - } |
|
60 | + public function __construct(stdClass $update) { |
|
61 | + parent::__construct($update, self::subs); |
|
62 | + } |
|
63 | 63 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @param string $range Your range ip for check , if you didn't specify the block , it will be 32 |
33 | 33 | * @return bool |
34 | 34 | */ |
35 | - public static function ipInRange (string $ip, string $range): bool { |
|
35 | + public static function ipInRange(string $ip, string $range): bool { |
|
36 | 36 | if (!str_contains($range, '/')) { |
37 | 37 | $range .= '/32'; |
38 | 38 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @param string $ip Your ip to be check is telegram or not e.g. '192.168.1.1' |
52 | 52 | * @return bool |
53 | 53 | */ |
54 | - public static function isTelegram (string $ip): bool { |
|
54 | + public static function isTelegram(string $ip): bool { |
|
55 | 55 | return self::ipInRange($ip, '149.154.160.0/20') || self::ipInRange($ip, '91.108.4.0/22'); |
56 | 56 | } |
57 | 57 | |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | * @param string $ip Your ip to be check is CloudFlare or not e.g. '192.168.1.1' |
66 | 66 | * @return bool |
67 | 67 | */ |
68 | - public static function isCloudFlare (string $ip): bool { |
|
68 | + public static function isCloudFlare(string $ip): bool { |
|
69 | 69 | $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']; |
70 | 70 | foreach ($cf_ips as $cf_ip) { |
71 | - if (self::ipInRange($ip,$cf_ip)) { |
|
71 | + if (self::ipInRange($ip, $cf_ip)) { |
|
72 | 72 | return true; |
73 | 73 | } |
74 | 74 | } |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | * @param bool $verify check token with telegram or not |
90 | 90 | * @return bool|array return array when verify is active and token is true array of telegram getMe result |
91 | 91 | */ |
92 | - public static function isToken (string $token, bool $verify = false): bool|array { |
|
92 | + public static function isToken(string $token, bool $verify = false): bool | array { |
|
93 | 93 | if (preg_match('/^(\d{8,10}):[\w\-]{35}$/', $token)) { |
94 | - if ($verify){ |
|
94 | + if ($verify) { |
|
95 | 95 | $res = telegram::me($token); |
96 | 96 | if ($res['ok']) { |
97 | 97 | return $res['result']; |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | * @param string $characters e.g. => 'abcdefg' |
123 | 123 | * @return string |
124 | 124 | */ |
125 | - public static function randomString (int $length = 16, string $characters = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'): string { |
|
125 | + public static function randomString(int $length = 16, string $characters = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'): string { |
|
126 | 126 | $rand_string = ''; |
127 | 127 | $char_len = strlen($characters) - 1; |
128 | - for ($i = 0; $i < $length; $i ++) { |
|
128 | + for ($i = 0; $i < $length; $i++) { |
|
129 | 129 | $rand_string .= $characters[rand(0, $char_len)]; |
130 | 130 | } |
131 | 131 | return $rand_string; |
@@ -144,10 +144,10 @@ discard block |
||
144 | 144 | * @param string $mode Your selected mode e.g. => `parseMode::HTML` | `HTML` |
145 | 145 | * @return string|false return false when mode is incorrect |
146 | 146 | */ |
147 | - public static function modeEscape (string $text, string $mode = parseMode::HTML): string|false { |
|
147 | + public static function modeEscape(string $text, string $mode = parseMode::HTML): string | false { |
|
148 | 148 | return match ($mode) { |
149 | - parseMode::HTML => str_replace(['&', '<', '>',], ["&", "<", ">",], $text), |
|
150 | - parseMode::MARKDOWN => str_replace(['\\', '_', '*', '`', '['], ['\\\\', '\_', '\*', '\`', '\[',], $text), |
|
149 | + parseMode::HTML => str_replace(['&', '<', '>', ], ["&", "<", ">", ], $text), |
|
150 | + parseMode::MARKDOWN => str_replace(['\\', '_', '*', '`', '['], ['\\\\', '\_', '\*', '\`', '\[', ], $text), |
|
151 | 151 | parseMode::MARKDOWNV2 => str_replace( |
152 | 152 | ['_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!', '\\'], |
153 | 153 | ['\_', '\*', '\[', '\]', '\(', '\)', '\~', '\`', '\>', '\#', '\+', '\-', '\=', '\|', '\{', '\}', '\.', '\!', '\\\\'], |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | * @param int $precision e.g. => 2 |
174 | 174 | * @return string |
175 | 175 | */ |
176 | - public static function byteFormat (int $byte, int $precision = 2): string { |
|
176 | + public static function byteFormat(int $byte, int $precision = 2): string { |
|
177 | 177 | $rate_counter = 0; |
178 | 178 | |
179 | - while ($byte > 1024){ |
|
179 | + while ($byte > 1024) { |
|
180 | 180 | $byte /= 1024; |
181 | 181 | $rate_counter++; |
182 | 182 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $byte = round($byte, $precision); |
186 | 186 | } |
187 | 187 | |
188 | - return $byte . ' ' . ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'][$rate_counter]; |
|
188 | + return $byte.' '.['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'][$rate_counter]; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * @param bool $format if you set this true , you will receive symbolic string like 2.76MB |
206 | 206 | * @return string|int|false string for formatted data , int for normal data , false when size can not be found(file not found or ...) |
207 | 207 | */ |
208 | - public static function size (string $path, bool $format = true): string|int|false { |
|
208 | + public static function size(string $path, bool $format = true): string | int | false { |
|
209 | 209 | if (filter_var($path, FILTER_VALIDATE_URL)) { |
210 | 210 | $ch = curl_init($path); |
211 | 211 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
@@ -214,14 +214,14 @@ |
||
214 | 214 | curl_exec($ch); |
215 | 215 | $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD); |
216 | 216 | curl_close($ch); |
217 | - } |
|
218 | - else { |
|
217 | + } else { |
|
219 | 218 | $size = file_exists($path) ? filesize($path) : false; |
220 | 219 | } |
221 | 220 | |
222 | 221 | if (isset($size) && is_numeric($size)) { |
223 | 222 | return $format ? tools::rateConverter($size) : $size; |
224 | - } |
|
225 | - else return false; |
|
223 | + } else { |
|
224 | + return false; |
|
225 | + } |
|
226 | 226 | } |
227 | 227 | } |
228 | 228 | \ No newline at end of file |
@@ -8,20 +8,20 @@ |
||
8 | 8 | * This object represents an animated emoji that displays a random value. |
9 | 9 | */ |
10 | 10 | class dice extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | 13 | |
14 | - /** Emoji on which the dice throw animation is based */ |
|
15 | - public string $emoji; |
|
14 | + /** Emoji on which the dice throw animation is based */ |
|
15 | + public string $emoji; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Value of the dice, 1-6 for “ |
@@ -6,3525 +6,3525 @@ |
||
6 | 6 | * Emojis class for simple emoji usage |
7 | 7 | */ |
8 | 8 | class emojis { |
9 | - public const GRINNING_FACE = ' |