@@ -6,19 +6,19 @@ |
||
6 | 6 | * types of message entity |
7 | 7 | */ |
8 | 8 | class messageEntityTypes { |
9 | - public const MENTION = 'mention'; |
|
10 | - public const HASHTAG = 'hashtag'; |
|
11 | - public const CASHTAG = 'cashtag'; |
|
12 | - public const BOT_COMMAND = 'bot_command'; |
|
13 | - public const URL = 'url'; |
|
14 | - public const EMAIL = 'email'; |
|
15 | - public const PHONE_NUMBER = 'phone_number'; |
|
16 | - public const BOLD = 'bold'; |
|
17 | - public const ITALIC = 'italic'; |
|
18 | - public const UNDERLINE = 'underline'; |
|
19 | - public const STRIKETHROUGH = 'strikethrough'; |
|
20 | - public const CODE = 'code'; |
|
21 | - public const PRE = 'pre'; |
|
22 | - public const TEXT_LINK = 'text_link'; |
|
23 | - public const TEXT_MENTION = 'text_mention'; |
|
9 | + public const MENTION = 'mention'; |
|
10 | + public const HASHTAG = 'hashtag'; |
|
11 | + public const CASHTAG = 'cashtag'; |
|
12 | + public const BOT_COMMAND = 'bot_command'; |
|
13 | + public const URL = 'url'; |
|
14 | + public const EMAIL = 'email'; |
|
15 | + public const PHONE_NUMBER = 'phone_number'; |
|
16 | + public const BOLD = 'bold'; |
|
17 | + public const ITALIC = 'italic'; |
|
18 | + public const UNDERLINE = 'underline'; |
|
19 | + public const STRIKETHROUGH = 'strikethrough'; |
|
20 | + public const CODE = 'code'; |
|
21 | + public const PRE = 'pre'; |
|
22 | + public const TEXT_LINK = 'text_link'; |
|
23 | + public const TEXT_MENTION = 'text_mention'; |
|
24 | 24 | } |
@@ -6,21 +6,21 @@ |
||
6 | 6 | * User status in the chat |
7 | 7 | */ |
8 | 8 | class chatMemberStatus { |
9 | - /** The creator of the chat */ |
|
10 | - public const CREATOR = 'creator'; |
|
9 | + /** The creator of the chat */ |
|
10 | + public const CREATOR = 'creator'; |
|
11 | 11 | |
12 | - /** The admin of the chat */ |
|
13 | - public const ADMINISTRATOR = 'administrator'; |
|
12 | + /** The admin of the chat */ |
|
13 | + public const ADMINISTRATOR = 'administrator'; |
|
14 | 14 | |
15 | - /** The member of the chat */ |
|
16 | - public const MEMBER = 'member'; |
|
15 | + /** The member of the chat */ |
|
16 | + public const MEMBER = 'member'; |
|
17 | 17 | |
18 | - /** Restricted in the chat */ |
|
19 | - public const RESTRICTED = 'restricted'; |
|
18 | + /** Restricted in the chat */ |
|
19 | + public const RESTRICTED = 'restricted'; |
|
20 | 20 | |
21 | - /** Left or not joined in the chat */ |
|
22 | - public const LEFT = 'left'; |
|
21 | + /** Left or not joined in the chat */ |
|
22 | + public const LEFT = 'left'; |
|
23 | 23 | |
24 | - /** Kicked in the chat */ |
|
25 | - public const KICKED = 'kicked'; |
|
24 | + /** Kicked in the chat */ |
|
25 | + public const KICKED = 'kicked'; |
|
26 | 26 | } |
@@ -6,10 +6,10 @@ |
||
6 | 6 | * Different type of passport sources |
7 | 7 | */ |
8 | 8 | class passportSources { |
9 | - public const DATA = 'data'; |
|
10 | - public const FRONT_SIDE = 'front_side'; |
|
11 | - public const REVERSE_SIDE = 'reverse_side'; |
|
12 | - public const SELFIE = 'selfie'; |
|
13 | - public const FILE = 'file'; |
|
14 | - public const FILES = 'files'; |
|
9 | + public const DATA = 'data'; |
|
10 | + public const FRONT_SIDE = 'front_side'; |
|
11 | + public const REVERSE_SIDE = 'reverse_side'; |
|
12 | + public const SELFIE = 'selfie'; |
|
13 | + public const FILE = 'file'; |
|
14 | + public const FILES = 'files'; |
|
15 | 15 | } |
@@ -6,8 +6,8 @@ |
||
6 | 6 | * Mask positions point which you can use in Sticker |
7 | 7 | */ |
8 | 8 | class maskPositionPoint { |
9 | - public const FOREHEAD = 'forehead'; |
|
10 | - public const EYES = 'eyes'; |
|
11 | - public const MOUTH = 'mouth'; |
|
12 | - public const CHIN = 'chin'; |
|
9 | + public const FOREHEAD = 'forehead'; |
|
10 | + public const EYES = 'eyes'; |
|
11 | + public const MOUTH = 'mouth'; |
|
12 | + public const CHIN = 'chin'; |
|
13 | 13 | } |
@@ -6,24 +6,24 @@ |
||
6 | 6 | * types of message entity |
7 | 7 | */ |
8 | 8 | class telegramLimits { |
9 | - /** Download file limit in Byte. (20 MB). For the moment, bots can download files of up to 20MB in size. */ |
|
10 | - public const DOWNLOAD = '20971520'; |
|
9 | + /** Download file limit in Byte. (20 MB). For the moment, bots can download files of up to 20MB in size. */ |
|
10 | + public const DOWNLOAD = '20971520'; |
|
11 | 11 | |
12 | - /** Upload file limit in Byte. (50 MB) */ |
|
13 | - public const UPLOAD = '52428800'; |
|
12 | + /** Upload file limit in Byte. (50 MB) */ |
|
13 | + public const UPLOAD = '52428800'; |
|
14 | 14 | |
15 | - /** Caption max characters length */ |
|
16 | - public const CAPTION_LENGTH = '1024'; |
|
15 | + /** Caption max characters length */ |
|
16 | + public const CAPTION_LENGTH = '1024'; |
|
17 | 17 | |
18 | - /** Text max characters length */ |
|
19 | - public const TEXT_LENGTH = '4096'; |
|
18 | + /** Text max characters length */ |
|
19 | + public const TEXT_LENGTH = '4096'; |
|
20 | 20 | |
21 | - /** Minimum period in seconds for which the location will be updated (1 minute) */ |
|
22 | - public const MIN_LIVE_PERIOD = '60'; |
|
21 | + /** Minimum period in seconds for which the location will be updated (1 minute) */ |
|
22 | + public const MIN_LIVE_PERIOD = '60'; |
|
23 | 23 | |
24 | - /** Maximum period in seconds for which the location will be updated (24 hours) */ |
|
25 | - public const MAX_LIVE_PERIOD = '86400'; |
|
24 | + /** Maximum period in seconds for which the location will be updated (24 hours) */ |
|
25 | + public const MAX_LIVE_PERIOD = '86400'; |
|
26 | 26 | |
27 | - /** Maximum poll question length */ |
|
28 | - public const POLL_QUESTION_LENGTH = '300'; |
|
27 | + /** Maximum poll question length */ |
|
28 | + public const POLL_QUESTION_LENGTH = '300'; |
|
29 | 29 | } |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use mysqli; |
6 | 6 | |
7 | 7 | class db { |
8 | - public static function init (array|mysqli $db) { |
|
8 | + public static function init(array | mysqli $db) { |
|
9 | 9 | |
10 | 10 | } |
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -225,18 +225,18 @@ discard block |
||
225 | 225 | ]; |
226 | 226 | |
227 | 227 | |
228 | - public static function __callStatic (string $name, array $arguments) { |
|
228 | + public static function __callStatic(string $name, array $arguments) { |
|
229 | 229 | if ($action = self::methodAction($name)) { |
230 | - self::keysName($action,$arguments); |
|
231 | - self::readyFile($action,$arguments); |
|
230 | + self::keysName($action, $arguments); |
|
231 | + self::readyFile($action, $arguments); |
|
232 | 232 | print_r($arguments); |
233 | 233 | } |
234 | 234 | else { |
235 | - logger::write("$name method is not supported",'error'); |
|
235 | + logger::write("$name method is not supported", 'error'); |
|
236 | 236 | } |
237 | 237 | } |
238 | 238 | |
239 | - private static function keysName (string $name, array &$arguments) { |
|
239 | + private static function keysName(string $name, array &$arguments) { |
|
240 | 240 | foreach ($arguments as $key => $argument) { |
241 | 241 | if (is_numeric($key) && isset(self::METHODS_KEYS[$name][$key])) { |
242 | 242 | $arguments[self::METHODS_KEYS[$name][$key]] = $argument; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
248 | - private static function methodAction(string $name): string|false { |
|
248 | + private static function methodAction(string $name): string | false { |
|
249 | 249 | return self::METHODS_ACTION[strtolower($name)] ?? false; |
250 | 250 | } |
251 | 251 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | - private static function methodFile(string $name): array|false { |
|
269 | + private static function methodFile(string $name): array | false { |
|
270 | 270 | return self::METHODS_WITH_FILE[$name] ?? false; |
271 | 271 | } |
272 | 272 | } |
273 | 273 | \ No newline at end of file |
@@ -230,8 +230,7 @@ discard block |
||
230 | 230 | self::keysName($action,$arguments); |
231 | 231 | self::readyFile($action,$arguments); |
232 | 232 | print_r($arguments); |
233 | - } |
|
234 | - else { |
|
233 | + } else { |
|
235 | 234 | logger::write("$name method is not supported",'error'); |
236 | 235 | } |
237 | 236 | } |
@@ -256,8 +255,7 @@ discard block |
||
256 | 255 | $arguments['media'][$key]['media'] = new CURLFile($media['media']); |
257 | 256 | } |
258 | 257 | } |
259 | - } |
|
260 | - elseif ($file_params = self::methodFile($name)) { |
|
258 | + } elseif ($file_params = self::methodFile($name)) { |
|
261 | 259 | foreach ($file_params as $param) { |
262 | 260 | if (isset($arguments[$param]) && file_exists($arguments[$param])) { |
263 | 261 | $arguments[$param] = new CURLFile($arguments[$param]); |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | namespace BPT\api; |
4 | 4 | |
5 | 5 | class telegram { |
6 | - public function __call (string $name, array $arguments) { |
|
6 | + public function __call(string $name, array $arguments) { |
|
7 | 7 | if (!isset($arguments[1]) && is_array($arguments[0])) { |
8 | 8 | request::$name(...$arguments[0]); |
9 | 9 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | - public static function __callStatic (string $name, array $arguments) { |
|
15 | + public static function __callStatic(string $name, array $arguments) { |
|
16 | 16 | if (!isset($arguments[1]) && is_array($arguments[0])) { |
17 | 17 | request::$name(...$arguments[0]); |
18 | 18 | } |
@@ -6,8 +6,7 @@ discard block |
||
6 | 6 | public function __call (string $name, array $arguments) { |
7 | 7 | if (!isset($arguments[1]) && is_array($arguments[0])) { |
8 | 8 | request::$name(...$arguments[0]); |
9 | - } |
|
10 | - else { |
|
9 | + } else { |
|
11 | 10 | request::$name($arguments); |
12 | 11 | } |
13 | 12 | } |
@@ -15,8 +14,7 @@ discard block |
||
15 | 14 | public static function __callStatic (string $name, array $arguments) { |
16 | 15 | if (!isset($arguments[1]) && is_array($arguments[0])) { |
17 | 16 | request::$name(...$arguments[0]); |
18 | - } |
|
19 | - else { |
|
17 | + } else { |
|
20 | 18 | request::$name(...$arguments); |
21 | 19 | } |
22 | 20 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | private static $handler; |
9 | 9 | |
10 | 10 | |
11 | - public static function init (int $log_size = 10) { |
|
11 | + public static function init(int $log_size = 10) { |
|
12 | 12 | self::$log_size = $log_size; |
13 | 13 | if (file_exists('BPT.log') && !(filesize('BPT.log') > self::$log_size * 1024 * 1024)) { |
14 | 14 | $mode = 'a'; |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | self::$handler = fopen('BPT.log', $mode); |
23 | 23 | |
24 | 24 | if ($write) { |
25 | - fwrite(self::$handler,"♥♥♥♥♥♥♥♥♥♥♥♥♥♥ BPT Library ♥♥♥♥♥♥♥♥♥♥♥♥♥♥\nTnx for using our library\nSome information about us :\nAuthor : @Im_Miaad\nHelper : @A_LiReza_ME\nChannel : @BPT_CH\nOur Website : https://bptlib.ir\n\nIf you have any problem with our library\nContact to our supports\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥ BPT Library ♥♥♥♥♥♥♥♥♥♥♥♥♥♥\nINFO : BPT Library LOG STARTED ...\nwarning : this file automatically deleted when its size reached log_size setting, do not delete it manually\n\n"); |
|
25 | + fwrite(self::$handler, "♥♥♥♥♥♥♥♥♥♥♥♥♥♥ BPT Library ♥♥♥♥♥♥♥♥♥♥♥♥♥♥\nTnx for using our library\nSome information about us :\nAuthor : @Im_Miaad\nHelper : @A_LiReza_ME\nChannel : @BPT_CH\nOur Website : https://bptlib.ir\n\nIf you have any problem with our library\nContact to our supports\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥ BPT Library ♥♥♥♥♥♥♥♥♥♥♥♥♥♥\nINFO : BPT Library LOG STARTED ...\nwarning : this file automatically deleted when its size reached log_size setting, do not delete it manually\n\n"); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
29 | 29 | public static function write($data, $type = '') { |
30 | 30 | if (!is_null(self::$handler)) { |
31 | - $text = date('Y/m/d H:i:s') . ( $type === '' ? " : $data\n\n" : " : ⤵\n$type : $data\n\n" ); |
|
31 | + $text = date('Y/m/d H:i:s').($type === '' ? " : $data\n\n" : " : ⤵\n$type : $data\n\n"); |
|
32 | 32 | fwrite(self::$handler, $text); |
33 | 33 | } |
34 | 34 | } |
@@ -13,8 +13,7 @@ |
||
13 | 13 | if (file_exists('BPT.log') && !(filesize('BPT.log') > self::$log_size * 1024 * 1024)) { |
14 | 14 | $mode = 'a'; |
15 | 15 | $write = false; |
16 | - } |
|
17 | - else { |
|
16 | + } else { |
|
18 | 17 | $mode = 'w'; |
19 | 18 | $write = true; |
20 | 19 | } |