@@ -22,37 +22,37 @@ discard block |
||
22 | 22 | public int $id; |
23 | 23 | |
24 | 24 | /** True, if this user is a bot */ |
25 | - public null|bool $is_bot = null; |
|
25 | + public null | bool $is_bot = null; |
|
26 | 26 | |
27 | 27 | /** User's or bot's first name */ |
28 | - public null|string $first_name = null; |
|
28 | + public null | string $first_name = null; |
|
29 | 29 | |
30 | 30 | /** Optional. User's or bot's last name */ |
31 | - public null|string $last_name = null; |
|
31 | + public null | string $last_name = null; |
|
32 | 32 | |
33 | 33 | /** Optional. User's or bot's username */ |
34 | - public null|string $username = null; |
|
34 | + public null | string $username = null; |
|
35 | 35 | |
36 | 36 | /** Optional. IETF language tag of the user's language */ |
37 | - public null|string $language_code = null; |
|
37 | + public null | string $language_code = null; |
|
38 | 38 | |
39 | 39 | /** Optional. True, if this user is a Telegram Premium user */ |
40 | - public null|bool $is_premium = null; |
|
40 | + public null | bool $is_premium = null; |
|
41 | 41 | |
42 | 42 | /** Optional. True, if this user added the bot to the attachment menu */ |
43 | - public null|bool $added_to_attachment_menu = null; |
|
43 | + public null | bool $added_to_attachment_menu = null; |
|
44 | 44 | |
45 | 45 | /** Optional. True, if the bot can be invited to groups. Returned only in getMe. */ |
46 | - public null|bool $can_join_groups = null; |
|
46 | + public null | bool $can_join_groups = null; |
|
47 | 47 | |
48 | 48 | /** Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. */ |
49 | - public null|bool $can_read_all_group_messages = null; |
|
49 | + public null | bool $can_read_all_group_messages = null; |
|
50 | 50 | |
51 | 51 | /** Optional. True, if the bot supports inline queries. Returned only in getMe. */ |
52 | - public null|bool $supports_inline_queries = null; |
|
52 | + public null | bool $supports_inline_queries = null; |
|
53 | 53 | |
54 | 54 | |
55 | - public function __construct(stdClass|null $object = null) { |
|
55 | + public function __construct(stdClass | null $object = null) { |
|
56 | 56 | if ($object != null) { |
57 | 57 | parent::__construct($object, self::subs); |
58 | 58 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @return string |
84 | 84 | */ |
85 | 85 | public function fullName(bool $nameFirst = true): string { |
86 | - return trim($nameFirst ? $this->first_name . ' ' . $this->last_name : $this->last_name . ' ' . $this->first_name); |
|
86 | + return trim($nameFirst ? $this->first_name.' '.$this->last_name : $this->last_name.' '.$this->first_name); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @return userProfilePhotos|responseError |
97 | 97 | */ |
98 | - public function getProfiles(int|null $offset = null, int|null $limit = null, bool $answer = null): userProfilePhotos|responseError { |
|
98 | + public function getProfiles(int | null $offset = null, int | null $limit = null, bool $answer = null): userProfilePhotos | responseError { |
|
99 | 99 | return telegram::getUserProfilePhotos($this->id, $offset, $limit, answer: $answer); |
100 | 100 | } |
101 | 101 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @return string |
111 | 111 | */ |
112 | - public function getMention (string $link_text = '', string $parse_mode = '') { |
|
112 | + public function getMention(string $link_text = '', string $parse_mode = '') { |
|
113 | 113 | if (empty($link_text)) { |
114 | 114 | $link_text = $this->fullName(); |
115 | 115 | } |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | public int $date; |
36 | 36 | |
37 | 37 | /** Optional. Bio of the user. */ |
38 | - public null|string $bio = null; |
|
38 | + public null | string $bio = null; |
|
39 | 39 | |
40 | 40 | /** Optional. Chat invite link that was used by the user to send the join request */ |
41 | - public null|chatInviteLink $invite_link = null; |
|
41 | + public null | chatInviteLink $invite_link = null; |
|
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 | } |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return responseError|bool |
56 | 56 | */ |
57 | - public function accept(bool $answer = null): responseError|bool { |
|
58 | - return telegram::approveChatJoinRequest($this->chat->id,$this->from->id, answer: $answer); |
|
57 | + public function accept(bool $answer = null): responseError | bool { |
|
58 | + return telegram::approveChatJoinRequest($this->chat->id, $this->from->id, answer: $answer); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | * |
66 | 66 | * @return responseError|bool |
67 | 67 | */ |
68 | - public function deny(bool $answer = null): responseError|bool { |
|
69 | - return telegram::declineChatJoinRequest($this->chat->id,$this->from->id, answer: $answer); |
|
68 | + public function deny(bool $answer = null): responseError | bool { |
|
69 | + return telegram::declineChatJoinRequest($this->chat->id, $this->from->id, answer: $answer); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @return responseError|bool |
78 | 78 | */ |
79 | - public function revokeLink(bool $answer = null): responseError|bool { |
|
79 | + public function revokeLink(bool $answer = null): responseError | bool { |
|
80 | 80 | return telegram::revokeChatInviteLink($this->invite_link->invite_link, $this->chat->id, answer: $answer); |
81 | 81 | } |
82 | 82 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public shippingAddress $shipping_address; |
26 | 26 | |
27 | 27 | |
28 | - public function __construct(stdClass|null $object = null) { |
|
28 | + public function __construct(stdClass | null $object = null) { |
|
29 | 29 | if ($object != null) { |
30 | 30 | parent::__construct($object, self::subs); |
31 | 31 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @return responseError|bool |
45 | 45 | */ |
46 | - public function answer (bool $ok, null|array $shipping_options = null, string|null $error_message = null, bool $answer = null): responseError|bool { |
|
46 | + public function answer(bool $ok, null | array $shipping_options = null, string | null $error_message = null, bool $answer = null): responseError | bool { |
|
47 | 47 | return telegram::answerShippingQuery($ok, $this->id, $shipping_options, $error_message, answer: $answer); |
48 | 48 | } |
49 | 49 | } |
@@ -31,23 +31,23 @@ discard block |
||
31 | 31 | public int $duration; |
32 | 32 | |
33 | 33 | /** Optional. Video thumbnail */ |
34 | - public null|photoSize $thumbnail = null; |
|
34 | + public null | photoSize $thumbnail = null; |
|
35 | 35 | |
36 | 36 | /** Optional. Original filename as defined by sender */ |
37 | - public null|string $file_name = null; |
|
37 | + public null | string $file_name = null; |
|
38 | 38 | |
39 | 39 | /** Optional. MIME type of the file as defined by sender */ |
40 | - public null|string $mime_type = null; |
|
40 | + public null | string $mime_type = null; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have |
44 | 44 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
45 | 45 | * integer or double-precision float type are safe for storing this value. |
46 | 46 | */ |
47 | - public null|int $file_size = null; |
|
47 | + public null | int $file_size = null; |
|
48 | 48 | |
49 | 49 | |
50 | - public function __construct(stdClass|null $object = null) { |
|
50 | + public function __construct(stdClass | null $object = null) { |
|
51 | 51 | if ($object != null) { |
52 | 52 | parent::__construct($object, self::subs); |
53 | 53 | } |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return bool|string string will be returned when destination doesn't set |
70 | 70 | */ |
71 | - public function download(string|null $destination = null): bool|string { |
|
72 | - return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp4',$this->file_id); |
|
71 | + public function download(string | null $destination = null): bool | string { |
|
72 | + return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp4', $this->file_id); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | * should be always known for requests sent from official clients and most third-party clients, unless the |
32 | 32 | * request was sent from a secret chat |
33 | 33 | */ |
34 | - public null|string $chat_type = null; |
|
34 | + public null | string $chat_type = null; |
|
35 | 35 | |
36 | 36 | /** Optional. Sender location, only for bots that request user location */ |
37 | - public null|location $location = null; |
|
37 | + public null | location $location = null; |
|
38 | 38 | |
39 | 39 | |
40 | - public function __construct(stdClass|null $object = null) { |
|
40 | + public function __construct(stdClass | null $object = null) { |
|
41 | 41 | if ($object != null) { |
42 | 42 | parent::__construct($object, self::subs); |
43 | 43 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return responseError|bool |
59 | 59 | */ |
60 | - public function answer(array $results, int|null $cache_time = null, bool|null $is_personal = null, string|null $next_offset = null, string|null $switch_pm_text = null, string|null $switch_pm_parameter = null, bool $answer = null): responseError|bool { |
|
60 | + public function answer(array $results, int | null $cache_time = null, bool | null $is_personal = null, string | null $next_offset = null, string | null $switch_pm_text = null, string | null $switch_pm_parameter = null, bool $answer = null): responseError | bool { |
|
61 | 61 | return telegram::answerInlineQuery($results, $this->id, $cache_time, $is_personal, $next_offset, $switch_pm_text, $switch_pm_parameter, answer: true); |
62 | 62 | } |
63 | 63 | } |
@@ -25,17 +25,17 @@ discard block |
||
25 | 25 | public int $duration; |
26 | 26 | |
27 | 27 | /** Optional. MIME type of the file as defined by sender */ |
28 | - public null|string $mime_type = null; |
|
28 | + public null | string $mime_type = null; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have |
32 | 32 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
33 | 33 | * integer or double-precision float type are safe for storing this value. |
34 | 34 | */ |
35 | - public null|int $file_size = null; |
|
35 | + public null | int $file_size = null; |
|
36 | 36 | |
37 | 37 | |
38 | - public function __construct(stdClass|null $object = null) { |
|
38 | + public function __construct(stdClass | null $object = null) { |
|
39 | 39 | if ($object != null) { |
40 | 40 | parent::__construct($object, self::subs); |
41 | 41 | } |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @return bool|string string will be returned when destination doesn't set |
58 | 58 | */ |
59 | - public function download(string|null $destination = null): bool|string { |
|
60 | - return telegram::downloadFile($destination ?? 'unknown.ogg',$this->file_id); |
|
59 | + public function download(string | null $destination = null): bool | string { |
|
60 | + return telegram::downloadFile($destination ?? 'unknown.ogg', $this->file_id); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -22,23 +22,23 @@ discard block |
||
22 | 22 | public string $file_unique_id; |
23 | 23 | |
24 | 24 | /** Optional. Document thumbnail as defined by sender */ |
25 | - public null|photoSize $thumbnail = null; |
|
25 | + public null | photoSize $thumbnail = null; |
|
26 | 26 | |
27 | 27 | /** Optional. Original filename as defined by sender */ |
28 | - public null|string $file_name = null; |
|
28 | + public null | string $file_name = null; |
|
29 | 29 | |
30 | 30 | /** Optional. MIME type of the file as defined by sender */ |
31 | - public null|string $mime_type = null; |
|
31 | + public null | string $mime_type = null; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have |
35 | 35 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
36 | 36 | * integer or double-precision float type are safe for storing this value. |
37 | 37 | */ |
38 | - public null|int $file_size = null; |
|
38 | + public null | int $file_size = null; |
|
39 | 39 | |
40 | 40 | |
41 | - public function __construct(stdClass|null $object = null) { |
|
41 | + public function __construct(stdClass | null $object = null) { |
|
42 | 42 | if ($object != null) { |
43 | 43 | parent::__construct($object, self::subs); |
44 | 44 | } |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | * |
60 | 60 | * @return bool|string string will be returned when destination doesn't set |
61 | 61 | */ |
62 | - public function download(string|null $destination = null): bool|string { |
|
63 | - return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.txt',$this->file_id); |
|
62 | + public function download(string | null $destination = null): bool | string { |
|
63 | + return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.txt', $this->file_id); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | public string $invoice_payload; |
33 | 33 | |
34 | 34 | /** Optional. Identifier of the shipping option chosen by the user */ |
35 | - public null|string $shipping_option_id = null; |
|
35 | + public null | string $shipping_option_id = null; |
|
36 | 36 | |
37 | 37 | /** Optional. Order information provided by the user */ |
38 | - public null|orderInfo $order_info = null; |
|
38 | + public null | orderInfo $order_info = null; |
|
39 | 39 | |
40 | 40 | |
41 | - public function __construct(stdClass|null $object = null) { |
|
41 | + public function __construct(stdClass | null $object = null) { |
|
42 | 42 | if ($object != null) { |
43 | 43 | parent::__construct($object, self::subs); |
44 | 44 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @return responseError|bool |
58 | 58 | */ |
59 | - public function answer (bool $ok, string|null $error_message = null, bool $answer = null): responseError|bool { |
|
59 | + public function answer(bool $ok, string | null $error_message = null, bool $answer = null): responseError | bool { |
|
60 | 60 | return telegram::answerPreCheckoutQuery($ok, $this->id, $error_message, answer: $answer); |
61 | 61 | } |
62 | 62 | } |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
32 | 32 | * integer or double-precision float type are safe for storing this value. |
33 | 33 | */ |
34 | - public null|int $file_size = null; |
|
34 | + public null | int $file_size = null; |
|
35 | 35 | |
36 | 36 | /** Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */ |
37 | - public null|string $file_path = null; |
|
37 | + public null | string $file_path = null; |
|
38 | 38 | |
39 | 39 | |
40 | - public function __construct(stdClass|null $object = null) { |
|
40 | + public function __construct(stdClass | null $object = null) { |
|
41 | 41 | if ($object != null) { |
42 | 42 | parent::__construct($object, self::subs); |
43 | 43 | } |
@@ -51,6 +51,6 @@ discard block |
||
51 | 51 | * @return string |
52 | 52 | */ |
53 | 53 | public function link(): string { |
54 | - return settings::$down_url . '/bot' . settings::$token . '/' . $this->file_path; |
|
54 | + return settings::$down_url.'/bot'.settings::$token.'/'.$this->file_path; |
|
55 | 55 | } |
56 | 56 | } |