@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * @internal Only for BPT self usage , Don't use it in your source! |
| 29 | 29 | */ |
| 30 | - public static function init (): void { |
|
| 30 | + public static function init(): void { |
|
| 31 | 31 | $host = settings::$db['host'] ?? 'localhost'; |
| 32 | 32 | $port = settings::$db['port'] ?? 3306; |
| 33 | 33 | $user = settings::$db['user'] ?? settings::$db['username'] ?? 'unknown'; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $dbname = settings::$db['dbname']; |
| 37 | 37 | self::$connection = new mysqli($host, $user, $pass, $dbname, $port); |
| 38 | 38 | if (self::$connection->connect_errno) { |
| 39 | - logger::write('SQL connection has problem : ' . self::$connection->connect_error, loggerTypes::ERROR); |
|
| 39 | + logger::write('SQL connection has problem : '.self::$connection->connect_error, loggerTypes::ERROR); |
|
| 40 | 40 | throw new bptException('SQL_CONNECTION_PROBLEM'); |
| 41 | 41 | } |
| 42 | 42 | if (self::$auto_process && !lock::exist('BPT-MYSQL')) { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - private static function install (): void { |
|
| 47 | + private static function install(): void { |
|
| 48 | 48 | self::pureQuery(" |
| 49 | 49 | CREATE TABLE `users` |
| 50 | 50 | ( |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | /** |
| 66 | 66 | * @internal Only for BPT self usage , Don't use it in your source! |
| 67 | 67 | */ |
| 68 | - public static function process (): void { |
|
| 68 | + public static function process(): void { |
|
| 69 | 69 | if (self::$auto_process) { |
| 70 | 70 | if (isset(BPT::$update->message)) { |
| 71 | 71 | self::processMessage(BPT::$update->message); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - private static function processMessage (message $update): void { |
|
| 88 | + private static function processMessage(message $update): void { |
|
| 89 | 89 | $type = $update->chat->type; |
| 90 | 90 | if ($type === chatType::PRIVATE) { |
| 91 | 91 | $user_id = $update->from->id; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - private static function processCallbackQuery (callbackQuery $update): void { |
|
| 114 | + private static function processCallbackQuery(callbackQuery $update): void { |
|
| 115 | 115 | $type = $update->message->chat->type; |
| 116 | 116 | if ($type === chatType::PRIVATE) { |
| 117 | 117 | $user_id = $update->from->id; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - private static function processInlineQuery (inlineQuery $update): void { |
|
| 124 | + private static function processInlineQuery(inlineQuery $update): void { |
|
| 125 | 125 | $type = $update->chat_type; |
| 126 | 126 | if ($type === chatType::PRIVATE || $type === chatType::SENDER) { |
| 127 | 127 | $user_id = $update->from->id; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - private static function processMyChatMember (chatMemberUpdated $update): void { |
|
| 134 | + private static function processMyChatMember(chatMemberUpdated $update): void { |
|
| 135 | 135 | $type = $update->chat->type; |
| 136 | 136 | if ($type === chatType::PRIVATE) { |
| 137 | 137 | if ($update->new_chat_member->status === chatMemberStatus::MEMBER) { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * |
| 149 | 149 | * @return mysqli |
| 150 | 150 | */ |
| 151 | - public static function getMysqli (): mysqli { |
|
| 151 | + public static function getMysqli(): mysqli { |
|
| 152 | 152 | return self::$connection; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * |
| 158 | 158 | * @return int|string |
| 159 | 159 | */ |
| 160 | - public static function affected_rows (): int|string { |
|
| 160 | + public static function affected_rows(): int | string { |
|
| 161 | 161 | return self::$connection->affected_rows; |
| 162 | 162 | } |
| 163 | 163 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * |
| 167 | 167 | * @return int|string |
| 168 | 168 | */ |
| 169 | - public static function insert_id (): int|string { |
|
| 169 | + public static function insert_id(): int | string { |
|
| 170 | 170 | return self::$connection->insert_id; |
| 171 | 171 | } |
| 172 | 172 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | * |
| 178 | 178 | * @return string |
| 179 | 179 | */ |
| 180 | - public static function escapeString (string $text): string { |
|
| 180 | + public static function escapeString(string $text): string { |
|
| 181 | 181 | return self::$connection->real_escape_string($text); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | * |
| 193 | 193 | * @return mysqli_result|bool |
| 194 | 194 | */ |
| 195 | - public static function pureQuery (string $query): mysqli_result|bool { |
|
| 195 | + public static function pureQuery(string $query): mysqli_result | bool { |
|
| 196 | 196 | return self::$connection->query($query); |
| 197 | 197 | } |
| 198 | 198 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | * |
| 212 | 212 | * @return mysqli_result|bool |
| 213 | 213 | */ |
| 214 | - public static function query (string $query, array $vars = [], bool $need_result = true): mysqli_result|bool { |
|
| 214 | + public static function query(string $query, array $vars = [], bool $need_result = true): mysqli_result | bool { |
|
| 215 | 215 | $prepare = self::$connection->prepare($query); |
| 216 | 216 | $types = ''; |
| 217 | 217 | foreach ($vars as $var) { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | if (!empty($types)) { |
| 229 | - $prepare->bind_param($types,...$vars); |
|
| 229 | + $prepare->bind_param($types, ...$vars); |
|
| 230 | 230 | } |
| 231 | 231 | if (!$prepare->execute()) { |
| 232 | 232 | logger::write(loggerTypes::WARNING, $prepare->error); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | return $need_result ? $prepare->get_result() : true; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - private static function makeArrayReady (string &$query, array $array, string $operator = ' AND '): array { |
|
| 238 | + private static function makeArrayReady(string &$query, array $array, string $operator = ' AND '): array { |
|
| 239 | 239 | $first = true; |
| 240 | 240 | $values = []; |
| 241 | 241 | foreach ($array as $name => $value) { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | return $values; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - private static function makeQueryReady (string &$query, array $where = null, int $count = null, int $offset = null): array { |
|
| 254 | + private static function makeQueryReady(string &$query, array $where = null, int $count = null, int $offset = null): array { |
|
| 255 | 255 | $values = []; |
| 256 | 256 | if (!empty($where)) { |
| 257 | 257 | $query .= " WHERE"; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * |
| 279 | 279 | * @return mysqli_result|bool |
| 280 | 280 | */ |
| 281 | - public static function delete (string $table, array $where = null, int $count = null, int $offset = null): mysqli_result|bool { |
|
| 281 | + public static function delete(string $table, array $where = null, int $count = null, int $offset = null): mysqli_result | bool { |
|
| 282 | 282 | $query = "DELETE FROM `$table`"; |
| 283 | 283 | $res = self::makeQueryReady($query, $where, $count, $offset); |
| 284 | 284 | return self::query($query, $res, false); |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | * |
| 298 | 298 | * @return mysqli_result|bool |
| 299 | 299 | */ |
| 300 | - public static function update (string $table, array $modify, array $where = null, int $count = null, int $offset = null): mysqli_result|bool { |
|
| 300 | + public static function update(string $table, array $modify, array $where = null, int $count = null, int $offset = null): mysqli_result | bool { |
|
| 301 | 301 | $query = "UPDATE `$table` SET"; |
| 302 | 302 | $values = self::makeArrayReady($query, $modify, ', '); |
| 303 | 303 | $res = self::makeQueryReady($query, $where, $count, $offset); |
@@ -315,11 +315,11 @@ discard block |
||
| 315 | 315 | * |
| 316 | 316 | * @return mysqli_result|bool |
| 317 | 317 | */ |
| 318 | - public static function insert (string $table, string|array $columns, array|string $values): mysqli_result|bool { |
|
| 318 | + public static function insert(string $table, string | array $columns, array | string $values): mysqli_result | bool { |
|
| 319 | 319 | $query = "INSERT INTO `$table`("; |
| 320 | - $query .= '`' . (is_string($columns) ? $columns : implode('`,`', $columns)) . '`) VALUES ('; |
|
| 320 | + $query .= '`'.(is_string($columns) ? $columns : implode('`,`', $columns)).'`) VALUES ('; |
|
| 321 | 321 | if (is_string($values)) $values = [$values]; |
| 322 | - $query .= '?' . str_repeat(',?', count($values) - 1) . ')'; |
|
| 322 | + $query .= '?'.str_repeat(',?', count($values) - 1).')'; |
|
| 323 | 323 | return self::query($query, $values, false); |
| 324 | 324 | } |
| 325 | 325 | |
@@ -338,13 +338,13 @@ discard block |
||
| 338 | 338 | * |
| 339 | 339 | * @return mysqli_result|bool |
| 340 | 340 | */ |
| 341 | - public static function select (string $table, array|string $columns = '*', array $where = null, int $count = null, int $offset = null): mysqli_result|bool { |
|
| 341 | + public static function select(string $table, array | string $columns = '*', array $where = null, int $count = null, int $offset = null): mysqli_result | bool { |
|
| 342 | 342 | $query = "SELECT "; |
| 343 | 343 | if ($columns == '*') { |
| 344 | 344 | $query .= "* "; |
| 345 | 345 | } |
| 346 | 346 | else { |
| 347 | - $query .= '`' . (is_string($columns) ? $columns : implode('`,`', $columns)) . '` '; |
|
| 347 | + $query .= '`'.(is_string($columns) ? $columns : implode('`,`', $columns)).'` '; |
|
| 348 | 348 | } |
| 349 | 349 | $query .= "FROM `$table`"; |
| 350 | 350 | $res = self::makeQueryReady($query, $where, $count, $offset); |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | * |
| 363 | 363 | * @return null|bool|array |
| 364 | 364 | */ |
| 365 | - public static function selectArray (string $table, array|string $columns = '*', array $where = null): bool|array|null { |
|
| 365 | + public static function selectArray(string $table, array | string $columns = '*', array $where = null): bool | array | null { |
|
| 366 | 366 | $res = self::select($table, $columns, $where, 1); |
| 367 | 367 | if ($res) { |
| 368 | 368 | return $res->fetch_assoc(); |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | * @param array|string $columns sets column that you want to retrieve , set '*' to retrieve all , default : '*' |
| 380 | 380 | * @param array|null $where Set your ifs default : null |
| 381 | 381 | */ |
| 382 | - public static function selectObject (string $table, array|string $columns = '*', array $where = null) { |
|
| 382 | + public static function selectObject(string $table, array | string $columns = '*', array $where = null) { |
|
| 383 | 383 | $res = self::select($table, $columns, $where, 1); |
| 384 | 384 | if ($res) { |
| 385 | 385 | return $res->fetch_object(); |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | * |
| 402 | 402 | * @return bool|Generator |
| 403 | 403 | */ |
| 404 | - public static function selectEach (string $table, array|string $columns = '*', array $where = null, int $count = null, int $offset = null): bool|Generator { |
|
| 404 | + public static function selectEach(string $table, array | string $columns = '*', array $where = null, int $count = null, int $offset = null): bool | Generator { |
|
| 405 | 405 | $res = self::select($table, $columns, $where, $count, $offset); |
| 406 | 406 | if ($res) { |
| 407 | 407 | while ($row = $res->fetch_assoc()) yield $row; |
@@ -21,37 +21,37 @@ discard block |
||
| 21 | 21 | public int $id; |
| 22 | 22 | |
| 23 | 23 | /** True, if this user is a bot */ |
| 24 | - public null|bool $is_bot = null; |
|
| 24 | + public null | bool $is_bot = null; |
|
| 25 | 25 | |
| 26 | 26 | /** User's or bot's first name */ |
| 27 | - public null|string $first_name = null; |
|
| 27 | + public null | string $first_name = null; |
|
| 28 | 28 | |
| 29 | 29 | /** Optional. User's or bot's last name */ |
| 30 | - public null|string $last_name = null; |
|
| 30 | + public null | string $last_name = null; |
|
| 31 | 31 | |
| 32 | 32 | /** Optional. User's or bot's username */ |
| 33 | - public null|string $username = null; |
|
| 33 | + public null | string $username = null; |
|
| 34 | 34 | |
| 35 | 35 | /** Optional. IETF language tag of the user's language */ |
| 36 | - public null|string $language_code = null; |
|
| 36 | + public null | string $language_code = null; |
|
| 37 | 37 | |
| 38 | 38 | /** Optional. True, if this user is a Telegram Premium user */ |
| 39 | - public null|bool $is_premium = null; |
|
| 39 | + public null | bool $is_premium = null; |
|
| 40 | 40 | |
| 41 | 41 | /** Optional. True, if this user added the bot to the attachment menu */ |
| 42 | - public null|bool $added_to_attachment_menu = null; |
|
| 42 | + public null | bool $added_to_attachment_menu = null; |
|
| 43 | 43 | |
| 44 | 44 | /** Optional. True, if the bot can be invited to groups. Returned only in getMe. */ |
| 45 | - public null|bool $can_join_groups = null; |
|
| 45 | + public null | bool $can_join_groups = null; |
|
| 46 | 46 | |
| 47 | 47 | /** Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. */ |
| 48 | - public null|bool $can_read_all_group_messages = null; |
|
| 48 | + public null | bool $can_read_all_group_messages = null; |
|
| 49 | 49 | |
| 50 | 50 | /** Optional. True, if the bot supports inline queries. Returned only in getMe. */ |
| 51 | - public null|bool $supports_inline_queries = null; |
|
| 51 | + public null | bool $supports_inline_queries = null; |
|
| 52 | 52 | |
| 53 | 53 | |
| 54 | - public function __construct(stdClass|null $object = null) { |
|
| 54 | + public function __construct(stdClass | null $object = null) { |
|
| 55 | 55 | if ($object != null) { |
| 56 | 56 | parent::__construct($object, self::subs); |
| 57 | 57 | } |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public function fullName(bool $nameFirst = true): string { |
| 65 | - return trim($nameFirst ? $this->first_name . ' ' . $this->last_name : $this->last_name . ' ' . $this->first_name); |
|
| 65 | + return trim($nameFirst ? $this->first_name.' '.$this->last_name : $this->last_name.' '.$this->first_name); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function getProfiles(int|null $offset = null, int|null $limit = null): userProfilePhotos|responseError { |
|
| 69 | - return telegram::getUserProfilePhotos($this->id,$offset,$limit); |
|
| 68 | + public function getProfiles(int | null $offset = null, int | null $limit = null): userProfilePhotos | responseError { |
|
| 69 | + return telegram::getUserProfilePhotos($this->id, $offset, $limit); |
|
| 70 | 70 | } |
| 71 | 71 | } |
@@ -30,85 +30,85 @@ discard block |
||
| 30 | 30 | public string $type; |
| 31 | 31 | |
| 32 | 32 | /** Optional. Title, for supergroups, channels and group chats */ |
| 33 | - public null|string $title = null; |
|
| 33 | + public null | string $title = null; |
|
| 34 | 34 | |
| 35 | 35 | /** Optional. Username, for private chats, supergroups and channels if available */ |
| 36 | - public null|string $username = null; |
|
| 36 | + public null | string $username = null; |
|
| 37 | 37 | |
| 38 | 38 | /** Optional. First name of the other party in a private chat */ |
| 39 | - public null|string $first_name = null; |
|
| 39 | + public null | string $first_name = null; |
|
| 40 | 40 | |
| 41 | 41 | /** Optional. Last name of the other party in a private chat */ |
| 42 | - public null|string $last_name = null; |
|
| 42 | + public null | string $last_name = null; |
|
| 43 | 43 | |
| 44 | 44 | /** Optional. True, if the supergroup chat is a forum (has topics enabled) */ |
| 45 | - public null|bool $is_forum = null; |
|
| 45 | + public null | bool $is_forum = null; |
|
| 46 | 46 | |
| 47 | 47 | /** Optional. Chat photo. Returned only in getChat. */ |
| 48 | - public null|chatPhoto $photo = null; |
|
| 48 | + public null | chatPhoto $photo = null; |
|
| 49 | 49 | |
| 50 | 50 | /** Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. */ |
| 51 | - public null|array $active_usernames = null; |
|
| 51 | + public null | array $active_usernames = null; |
|
| 52 | 52 | |
| 53 | 53 | /** Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. */ |
| 54 | - public null|string $emoji_status_custom_emoji_id = null; |
|
| 54 | + public null | string $emoji_status_custom_emoji_id = null; |
|
| 55 | 55 | |
| 56 | 56 | /** Optional. Bio of the other party in a private chat. Returned only in getChat. */ |
| 57 | - public null|string $bio = null; |
|
| 57 | + public null | string $bio = null; |
|
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * Optional. True, if privacy settings of the other party in the private chat allows to use |
| 61 | 61 | * tg://user?id=<user_id> links only in chats with the user. Returned only in getChat. |
| 62 | 62 | */ |
| 63 | - public null|bool $has_private_forwards = null; |
|
| 63 | + public null | bool $has_private_forwards = null; |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in |
| 67 | 67 | * the private chat. Returned only in getChat. |
| 68 | 68 | */ |
| 69 | - public null|bool $has_restricted_voice_and_video_messages = null; |
|
| 69 | + public null | bool $has_restricted_voice_and_video_messages = null; |
|
| 70 | 70 | |
| 71 | 71 | /** Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat. */ |
| 72 | - public null|bool $join_to_send_messages = null; |
|
| 72 | + public null | bool $join_to_send_messages = null; |
|
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. |
| 76 | 76 | * Returned only in getChat. |
| 77 | 77 | */ |
| 78 | - public null|bool $join_by_request = null; |
|
| 78 | + public null | bool $join_by_request = null; |
|
| 79 | 79 | |
| 80 | 80 | /** Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. */ |
| 81 | - public null|string $description = null; |
|
| 81 | + public null | string $description = null; |
|
| 82 | 82 | |
| 83 | 83 | /** Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. */ |
| 84 | - public null|string $invite_link = null; |
|
| 84 | + public null | string $invite_link = null; |
|
| 85 | 85 | |
| 86 | 86 | /** Optional. The most recent pinned message (by sending date). Returned only in getChat. */ |
| 87 | - public null|message $pinned_message = null; |
|
| 87 | + public null | message $pinned_message = null; |
|
| 88 | 88 | |
| 89 | 89 | /** Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. */ |
| 90 | - public null|chatPermissions $permissions = null; |
|
| 90 | + public null | chatPermissions $permissions = null; |
|
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged |
| 94 | 94 | * user; in seconds. Returned only in getChat. |
| 95 | 95 | */ |
| 96 | - public null|int $slow_mode_delay = null; |
|
| 96 | + public null | int $slow_mode_delay = null; |
|
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. |
| 100 | 100 | * Returned only in getChat. |
| 101 | 101 | */ |
| 102 | - public null|int $message_auto_delete_time = null; |
|
| 102 | + public null | int $message_auto_delete_time = null; |
|
| 103 | 103 | |
| 104 | 104 | /** Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */ |
| 105 | - public null|bool $has_protected_content = null; |
|
| 105 | + public null | bool $has_protected_content = null; |
|
| 106 | 106 | |
| 107 | 107 | /** Optional. For supergroups, name of group sticker set. Returned only in getChat. */ |
| 108 | - public null|string $sticker_set_name = null; |
|
| 108 | + public null | string $sticker_set_name = null; |
|
| 109 | 109 | |
| 110 | 110 | /** Optional. True, if the bot can change the group sticker set. Returned only in getChat. */ |
| 111 | - public null|bool $can_set_sticker_set = null; |
|
| 111 | + public null | bool $can_set_sticker_set = null; |
|
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | 114 | * Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice |
@@ -116,87 +116,87 @@ discard block |
||
| 116 | 116 | * languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed |
| 117 | 117 | * 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat. |
| 118 | 118 | */ |
| 119 | - public null|int $linked_chat_id = null; |
|
| 119 | + public null | int $linked_chat_id = null; |
|
| 120 | 120 | |
| 121 | 121 | /** Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat. */ |
| 122 | - public null|chatLocation $location = null; |
|
| 122 | + public null | chatLocation $location = null; |
|
| 123 | 123 | |
| 124 | 124 | |
| 125 | - public function __construct(stdClass|null $object = null) { |
|
| 125 | + public function __construct(stdClass | null $object = null) { |
|
| 126 | 126 | if ($object != null) { |
| 127 | 127 | parent::__construct($object, self::subs); |
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - public function isPrivate (): bool { |
|
| 131 | + public function isPrivate(): bool { |
|
| 132 | 132 | return $this->type === chatType::PRIVATE; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - public function isGroup (): bool { |
|
| 135 | + public function isGroup(): bool { |
|
| 136 | 136 | return $this->type === chatType::GROUP; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - public function isSuperGroup (): bool { |
|
| 139 | + public function isSuperGroup(): bool { |
|
| 140 | 140 | return $this->type === chatType::SUPERGROUP; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - public function isChannel (): bool { |
|
| 143 | + public function isChannel(): bool { |
|
| 144 | 144 | return $this->type === chatType::CHANNEL; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - public function leave(): responseError|bool { |
|
| 147 | + public function leave(): responseError | bool { |
|
| 148 | 148 | if ($this->isPrivate()) { |
| 149 | 149 | return false; |
| 150 | 150 | } |
| 151 | 151 | return telegram::leave($this->id); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - public function setPhoto(CURLFile|array $photo): responseError|bool { |
|
| 154 | + public function setPhoto(CURLFile | array $photo): responseError | bool { |
|
| 155 | 155 | if ($this->isPrivate()) { |
| 156 | 156 | return false; |
| 157 | 157 | } |
| 158 | - return telegram::setChatPhoto($photo,$this->id); |
|
| 158 | + return telegram::setChatPhoto($photo, $this->id); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - public function delPhoto(): responseError|bool { |
|
| 161 | + public function delPhoto(): responseError | bool { |
|
| 162 | 162 | if ($this->isPrivate()) { |
| 163 | 163 | return false; |
| 164 | 164 | } |
| 165 | 165 | return telegram::deleteChatPhoto($this->id); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - public function setTitle(string|array $title): responseError|bool { |
|
| 168 | + public function setTitle(string | array $title): responseError | bool { |
|
| 169 | 169 | if ($this->isPrivate()) { |
| 170 | 170 | return false; |
| 171 | 171 | } |
| 172 | - return telegram::setChatTitle($title,$this->id); |
|
| 172 | + return telegram::setChatTitle($title, $this->id); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - public function setDescription(string|null $description = null): responseError|bool { |
|
| 175 | + public function setDescription(string | null $description = null): responseError | bool { |
|
| 176 | 176 | if ($this->isPrivate()) { |
| 177 | 177 | return false; |
| 178 | 178 | } |
| 179 | - return telegram::setChatDescription($this->id,$description); |
|
| 179 | + return telegram::setChatDescription($this->id, $description); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - public function getAdmins(): bool|responseError|array { |
|
| 182 | + public function getAdmins(): bool | responseError | array { |
|
| 183 | 183 | if ($this->isPrivate()) { |
| 184 | 184 | return false; |
| 185 | 185 | } |
| 186 | 186 | return telegram::getChatAdministrators($this->id); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - public function getMembersCount(): bool|responseError|int { |
|
| 189 | + public function getMembersCount(): bool | responseError | int { |
|
| 190 | 190 | if ($this->isPrivate()) { |
| 191 | 191 | return false; |
| 192 | 192 | } |
| 193 | 193 | return telegram::getChatMemberCount($this->id); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - public function getMember(int|null $user_id = null): chatMember|bool|responseError { |
|
| 196 | + public function getMember(int | null $user_id = null): chatMember | bool | responseError { |
|
| 197 | 197 | if ($this->isPrivate()) { |
| 198 | 198 | return false; |
| 199 | 199 | } |
| 200 | - return telegram::getChatMember($this->id,$user_id); |
|
| 200 | + return telegram::getChatMember($this->id, $user_id); |
|
| 201 | 201 | } |
| 202 | 202 | } |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | public int $height; |
| 29 | 29 | |
| 30 | 30 | /** Optional. File size in bytes */ |
| 31 | - public null|int $file_size = null; |
|
| 31 | + public null | int $file_size = null; |
|
| 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 | } |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | * |
| 53 | 53 | * @return bool|string string will be returned when destination doesn't set |
| 54 | 54 | */ |
| 55 | - public function download(string|null $destination = null): bool|string { |
|
| 56 | - return telegram::downloadFile($destination ?? 'unknown.jpg',$this->file_id); |
|
| 55 | + public function download(string | null $destination = null): bool | string { |
|
| 56 | + return telegram::downloadFile($destination ?? 'unknown.jpg', $this->file_id); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public function link(): string { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public string $big_file_unique_id; |
| 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 | } |
@@ -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 $big = true): bool|string { |
|
| 63 | - return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp4',$big ? $this->big_file_id : $this->small_file_id); |
|
| 62 | + public function download(string | null $destination = null, bool $big = true): bool | string { |
|
| 63 | + return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp4', $big ? $this->big_file_id : $this->small_file_id); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | public function link(bool $big = true): string { |
@@ -25,29 +25,29 @@ discard block |
||
| 25 | 25 | public int $duration; |
| 26 | 26 | |
| 27 | 27 | /** Optional. Performer of the audio as defined by sender or by audio tags */ |
| 28 | - public null|string $performer = null; |
|
| 28 | + public null | string $performer = null; |
|
| 29 | 29 | |
| 30 | 30 | /** Optional. Title of the audio as defined by sender or by audio tags */ |
| 31 | - public null|string $title = null; |
|
| 31 | + public null | string $title = null; |
|
| 32 | 32 | |
| 33 | 33 | /** Optional. Original filename as defined by sender */ |
| 34 | - public null|string $file_name = null; |
|
| 34 | + public null | string $file_name = null; |
|
| 35 | 35 | |
| 36 | 36 | /** Optional. MIME type of the file as defined by sender */ |
| 37 | - public null|string $mime_type = null; |
|
| 37 | + public null | string $mime_type = null; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have |
| 41 | 41 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
| 42 | 42 | * integer or double-precision float type are safe for storing this value. |
| 43 | 43 | */ |
| 44 | - public null|int $file_size = null; |
|
| 44 | + public null | int $file_size = null; |
|
| 45 | 45 | |
| 46 | 46 | /** Optional. Thumbnail of the album cover to which the music file belongs */ |
| 47 | - public null|photoSize $thumb = null; |
|
| 47 | + public null | photoSize $thumb = 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.mp3',$this->file_id); |
|
| 71 | + public function download(string | null $destination = null): bool | string { |
|
| 72 | + return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp3', $this->file_id); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public function link(): string { |
@@ -31,28 +31,28 @@ |
||
| 31 | 31 | public bool $is_revoked; |
| 32 | 32 | |
| 33 | 33 | /** Optional. Invite link name */ |
| 34 | - public null|string $name = null; |
|
| 34 | + public null | string $name = null; |
|
| 35 | 35 | |
| 36 | 36 | /** Optional. Point in time (Unix timestamp) when the link will expire or has been expired */ |
| 37 | - public null|int $expire_date = null; |
|
| 37 | + public null | int $expire_date = null; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat |
| 41 | 41 | * via this invite link; 1-99999 |
| 42 | 42 | */ |
| 43 | - public null|int $member_limit = null; |
|
| 43 | + public null | int $member_limit = null; |
|
| 44 | 44 | |
| 45 | 45 | /** Optional. Number of pending join requests created using this link */ |
| 46 | - public null|int $pending_join_request_count = null; |
|
| 46 | + public null | int $pending_join_request_count = null; |
|
| 47 | 47 | |
| 48 | 48 | |
| 49 | - public function __construct(stdClass|null $object = null) { |
|
| 49 | + public function __construct(stdClass | null $object = null) { |
|
| 50 | 50 | if ($object != null) { |
| 51 | 51 | parent::__construct($object, self::subs); |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function revoke(): self|responseError|bool { |
|
| 55 | + public function revoke(): self | responseError | bool { |
|
| 56 | 56 | return $this->is_revoked ?? telegram::revokeChatInviteLink($this->invite_link); |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | public int $message_id; |
| 64 | 64 | |
| 65 | 65 | /** Optional. Unique identifier of a message thread to which the message belongs; for supergroups only */ |
| 66 | - public null|int $message_thread_id = null; |
|
| 66 | + public null | int $message_thread_id = null; |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field |
| 70 | 70 | * contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. |
| 71 | 71 | */ |
| 72 | - public null|user $from = null; |
|
| 72 | + public null | user $from = null; |
|
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake |
| 78 | 78 | * sender user in non-channel chats, if the message was sent on behalf of a chat. |
| 79 | 79 | */ |
| 80 | - public null|chat $sender_chat = null; |
|
| 80 | + public null | chat $sender_chat = null; |
|
| 81 | 81 | |
| 82 | 82 | /** Date the message was sent in Unix time */ |
| 83 | 83 | public int $date; |
@@ -86,185 +86,185 @@ discard block |
||
| 86 | 86 | public chat $chat; |
| 87 | 87 | |
| 88 | 88 | /** Optional. For forwarded messages, sender of the original message */ |
| 89 | - public null|user $forward_from = null; |
|
| 89 | + public null | user $forward_from = null; |
|
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * Optional. For messages forwarded from channels or from anonymous administrators, information about the |
| 93 | 93 | * original sender chat |
| 94 | 94 | */ |
| 95 | - public null|chat $forward_from_chat = null; |
|
| 95 | + public null | chat $forward_from_chat = null; |
|
| 96 | 96 | |
| 97 | 97 | /** Optional. For messages forwarded from channels, identifier of the original message in the channel */ |
| 98 | - public null|int $forward_from_message_id = null; |
|
| 98 | + public null | int $forward_from_message_id = null; |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, |
| 102 | 102 | * signature of the message sender if present |
| 103 | 103 | */ |
| 104 | - public null|string $forward_signature = null; |
|
| 104 | + public null | string $forward_signature = null; |
|
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in |
| 108 | 108 | * forwarded messages |
| 109 | 109 | */ |
| 110 | - public null|string $forward_sender_name = null; |
|
| 110 | + public null | string $forward_sender_name = null; |
|
| 111 | 111 | |
| 112 | 112 | /** Optional. For forwarded messages, date the original message was sent in Unix time */ |
| 113 | - public null|int $forward_date = null; |
|
| 113 | + public null | int $forward_date = null; |
|
| 114 | 114 | |
| 115 | 115 | /** Optional. True, if the message is sent to a forum topic */ |
| 116 | - public null|bool $is_topic_message = null; |
|
| 116 | + public null | bool $is_topic_message = null; |
|
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | 119 | * Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion |
| 120 | 120 | * group |
| 121 | 121 | */ |
| 122 | - public null|bool $is_automatic_forward = null; |
|
| 122 | + public null | bool $is_automatic_forward = null; |
|
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | 125 | * Optional. For replies, the original message. Note that the Message object in this field will not contain |
| 126 | 126 | * further reply_to_message fields even if it itself is a reply. |
| 127 | 127 | */ |
| 128 | - public null|message $reply_to_message = null; |
|
| 128 | + public null | message $reply_to_message = null; |
|
| 129 | 129 | |
| 130 | 130 | /** Optional. Bot through which the message was sent */ |
| 131 | - public null|user $via_bot = null; |
|
| 131 | + public null | user $via_bot = null; |
|
| 132 | 132 | |
| 133 | 133 | /** Optional. Date the message was last edited in Unix time */ |
| 134 | - public null|int $edit_date = null; |
|
| 134 | + public null | int $edit_date = null; |
|
| 135 | 135 | |
| 136 | 136 | /** Optional. True, if the message can't be forwarded */ |
| 137 | - public null|bool $has_protected_content = null; |
|
| 137 | + public null | bool $has_protected_content = null; |
|
| 138 | 138 | |
| 139 | 139 | /** Optional. The unique identifier of a media message group this message belongs to */ |
| 140 | - public null|string $media_group_id = null; |
|
| 140 | + public null | string $media_group_id = null; |
|
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | 143 | * Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group |
| 144 | 144 | * administrator |
| 145 | 145 | */ |
| 146 | - public null|string $author_signature = null; |
|
| 146 | + public null | string $author_signature = null; |
|
| 147 | 147 | |
| 148 | 148 | /** Optional. For text messages, the actual UTF-8 text of the message */ |
| 149 | - public null|string $text = null; |
|
| 149 | + public null | string $text = null; |
|
| 150 | 150 | |
| 151 | 151 | /** Optional. If user message was a commend , this parameter will be the commend */ |
| 152 | - public string|null $commend = null; |
|
| 152 | + public string | null $commend = null; |
|
| 153 | 153 | |
| 154 | 154 | /** Optional. If user message was a commend , this parameter will be the commend username(if exist) */ |
| 155 | - public string|null $commend_username = null; |
|
| 155 | + public string | null $commend_username = null; |
|
| 156 | 156 | |
| 157 | 157 | /** Optional. If user message was a commend , this parameter will be the commend payload(if exist) */ |
| 158 | - public string|null $commend_payload = null; |
|
| 158 | + public string | null $commend_payload = null; |
|
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | 161 | * Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text |
| 162 | 162 | * @var messageEntity[] |
| 163 | 163 | */ |
| 164 | - public null|array $entities = null; |
|
| 164 | + public null | array $entities = null; |
|
| 165 | 165 | |
| 166 | 166 | /** |
| 167 | 167 | * Optional. Message is an animation, information about the animation. For backward compatibility, when this |
| 168 | 168 | * field is set, the document field will also be set |
| 169 | 169 | */ |
| 170 | - public null|animation $animation = null; |
|
| 170 | + public null | animation $animation = null; |
|
| 171 | 171 | |
| 172 | 172 | /** Optional. Message is an audio file, information about the file */ |
| 173 | - public null|audio $audio = null; |
|
| 173 | + public null | audio $audio = null; |
|
| 174 | 174 | |
| 175 | 175 | /** Optional. Message is a general file, information about the file */ |
| 176 | - public null|document $document = null; |
|
| 176 | + public null | document $document = null; |
|
| 177 | 177 | |
| 178 | 178 | /** |
| 179 | 179 | * Optional. Message is a photo, available sizes of the photo |
| 180 | 180 | * @var photoSize[] |
| 181 | 181 | */ |
| 182 | - public null|array $photo = null; |
|
| 182 | + public null | array $photo = null; |
|
| 183 | 183 | |
| 184 | 184 | /** Optional. Message is a sticker, information about the sticker */ |
| 185 | - public null|sticker $sticker = null; |
|
| 185 | + public null | sticker $sticker = null; |
|
| 186 | 186 | |
| 187 | 187 | /** Optional. Message is a video, information about the video */ |
| 188 | - public null|video $video = null; |
|
| 188 | + public null | video $video = null; |
|
| 189 | 189 | |
| 190 | 190 | /** Optional. Message is a video note, information about the video message */ |
| 191 | - public null|videoNote $video_note = null; |
|
| 191 | + public null | videoNote $video_note = null; |
|
| 192 | 192 | |
| 193 | 193 | /** Optional. Message is a voice message, information about the file */ |
| 194 | - public null|voice $voice = null; |
|
| 194 | + public null | voice $voice = null; |
|
| 195 | 195 | |
| 196 | 196 | /** Optional. Caption for the animation, audio, document, photo, video or voice */ |
| 197 | - public null|string $caption = null; |
|
| 197 | + public null | string $caption = null; |
|
| 198 | 198 | |
| 199 | 199 | /** |
| 200 | 200 | * Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear |
| 201 | 201 | * in the caption |
| 202 | 202 | * @var messageEntity[] |
| 203 | 203 | */ |
| 204 | - public null|array $caption_entities = null; |
|
| 204 | + public null | array $caption_entities = null; |
|
| 205 | 205 | |
| 206 | 206 | /** Optional. Message is a shared contact, information about the contact */ |
| 207 | - public null|contact $contact = null; |
|
| 207 | + public null | contact $contact = null; |
|
| 208 | 208 | |
| 209 | 209 | /** Optional. Message is a dice with random value */ |
| 210 | - public null|dice $dice = null; |
|
| 210 | + public null | dice $dice = null; |
|
| 211 | 211 | |
| 212 | 212 | /** Optional. Message is a game, information about the game. More about games » */ |
| 213 | - public null|game $game = null; |
|
| 213 | + public null | game $game = null; |
|
| 214 | 214 | |
| 215 | 215 | /** Optional. Message is a native poll, information about the poll */ |
| 216 | - public null|poll $poll = null; |
|
| 216 | + public null | poll $poll = null; |
|
| 217 | 217 | |
| 218 | 218 | /** |
| 219 | 219 | * Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, |
| 220 | 220 | * the location field will also be set |
| 221 | 221 | */ |
| 222 | - public null|venue $venue = null; |
|
| 222 | + public null | venue $venue = null; |
|
| 223 | 223 | |
| 224 | 224 | /** Optional. Message is a shared location, information about the location */ |
| 225 | - public null|location $location = null; |
|
| 225 | + public null | location $location = null; |
|
| 226 | 226 | |
| 227 | 227 | /** |
| 228 | 228 | * Optional. New members that were added to the group or supergroup and information about them (the bot itself |
| 229 | 229 | * may be one of these members) |
| 230 | 230 | * @var user[] |
| 231 | 231 | */ |
| 232 | - public null|array $new_chat_members = null; |
|
| 232 | + public null | array $new_chat_members = null; |
|
| 233 | 233 | |
| 234 | 234 | /** Optional. A member was removed from the group, information about them (this member may be the bot itself) */ |
| 235 | - public null|user $left_chat_member = null; |
|
| 235 | + public null | user $left_chat_member = null; |
|
| 236 | 236 | |
| 237 | 237 | /** Optional. A chat title was changed to this value */ |
| 238 | - public null|string $new_chat_title = null; |
|
| 238 | + public null | string $new_chat_title = null; |
|
| 239 | 239 | |
| 240 | 240 | /** |
| 241 | 241 | * Optional. A chat photo was change to this value |
| 242 | 242 | * @var photoSize[] |
| 243 | 243 | */ |
| 244 | - public null|array $new_chat_photo = null; |
|
| 244 | + public null | array $new_chat_photo = null; |
|
| 245 | 245 | |
| 246 | 246 | /** Optional. Service message: the chat photo was deleted */ |
| 247 | - public null|bool $delete_chat_photo = null; |
|
| 247 | + public null | bool $delete_chat_photo = null; |
|
| 248 | 248 | |
| 249 | 249 | /** Optional. Service message: the group has been created */ |
| 250 | - public null|bool $group_chat_created = null; |
|
| 250 | + public null | bool $group_chat_created = null; |
|
| 251 | 251 | |
| 252 | 252 | /** |
| 253 | 253 | * Optional. Service message: the supergroup has been created. This field can't be received in a message coming |
| 254 | 254 | * through updates, because bot can't be a member of a supergroup when it is created. It can only be found in |
| 255 | 255 | * reply_to_message if someone replies to a very first message in a directly created supergroup. |
| 256 | 256 | */ |
| 257 | - public null|bool $supergroup_chat_created = null; |
|
| 257 | + public null | bool $supergroup_chat_created = null; |
|
| 258 | 258 | |
| 259 | 259 | /** |
| 260 | 260 | * Optional. Service message: the channel has been created. This field can't be received in a message coming |
| 261 | 261 | * through updates, because bot can't be a member of a channel when it is created. It can only be found in |
| 262 | 262 | * reply_to_message if someone replies to a very first message in a channel. |
| 263 | 263 | */ |
| 264 | - public null|bool $channel_chat_created = null; |
|
| 264 | + public null | bool $channel_chat_created = null; |
|
| 265 | 265 | |
| 266 | 266 | /** Optional. Service message: auto-delete timer settings changed in the chat */ |
| 267 | - public null|messageAutoDeleteTimerChanged $message_auto_delete_timer_changed = null; |
|
| 267 | + public null | messageAutoDeleteTimerChanged $message_auto_delete_timer_changed = null; |
|
| 268 | 268 | |
| 269 | 269 | /** |
| 270 | 270 | * Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for |
| 273 | 273 | * storing this identifier. |
| 274 | 274 | */ |
| 275 | - public null|int $migrate_to_chat_id = null; |
|
| 275 | + public null | int $migrate_to_chat_id = null; |
|
| 276 | 276 | |
| 277 | 277 | /** |
| 278 | 278 | * Optional. The supergroup has been migrated from a group with the specified identifier. This number may have |
@@ -280,70 +280,70 @@ discard block |
||
| 280 | 280 | * interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float |
| 281 | 281 | * type are safe for storing this identifier. |
| 282 | 282 | */ |
| 283 | - public null|int $migrate_from_chat_id = null; |
|
| 283 | + public null | int $migrate_from_chat_id = null; |
|
| 284 | 284 | |
| 285 | 285 | /** |
| 286 | 286 | * Optional. Specified message was pinned. Note that the Message object in this field will not contain further |
| 287 | 287 | * reply_to_message fields even if it is itself a reply. |
| 288 | 288 | */ |
| 289 | - public null|message $pinned_message = null; |
|
| 289 | + public null | message $pinned_message = null; |
|
| 290 | 290 | |
| 291 | 291 | /** Optional. Message is an invoice for a payment, information about the invoice. More about payments » */ |
| 292 | - public null|invoice $invoice = null; |
|
| 292 | + public null | invoice $invoice = null; |
|
| 293 | 293 | |
| 294 | 294 | /** |
| 295 | 295 | * Optional. Message is a service message about a successful payment, information about the payment. More about |
| 296 | 296 | * payments » |
| 297 | 297 | */ |
| 298 | - public null|successfulPayment $successful_payment = null; |
|
| 298 | + public null | successfulPayment $successful_payment = null; |
|
| 299 | 299 | |
| 300 | 300 | /** Optional. The domain name of the website on which the user has logged in. More about Telegram Login » */ |
| 301 | - public null|string $connected_website = null; |
|
| 301 | + public null | string $connected_website = null; |
|
| 302 | 302 | |
| 303 | 303 | /** Optional. Telegram Passport data */ |
| 304 | - public null|passportData $passport_data = null; |
|
| 304 | + public null | passportData $passport_data = null; |
|
| 305 | 305 | |
| 306 | 306 | /** |
| 307 | 307 | * Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live |
| 308 | 308 | * Location. |
| 309 | 309 | */ |
| 310 | - public null|proximityAlertTriggered $proximity_alert_triggered = null; |
|
| 310 | + public null | proximityAlertTriggered $proximity_alert_triggered = null; |
|
| 311 | 311 | |
| 312 | 312 | /** Optional. Service message: forum topic created */ |
| 313 | - public null|forumTopicCreated $forum_topic_created = null; |
|
| 313 | + public null | forumTopicCreated $forum_topic_created = null; |
|
| 314 | 314 | |
| 315 | 315 | /** Optional. Service message: forum topic closed */ |
| 316 | - public null|forumTopicClosed $forum_topic_closed = null; |
|
| 316 | + public null | forumTopicClosed $forum_topic_closed = null; |
|
| 317 | 317 | |
| 318 | 318 | /** Optional. Service message: forum topic reopened */ |
| 319 | - public null|forumTopicReopened $forum_topic_reopened = null; |
|
| 319 | + public null | forumTopicReopened $forum_topic_reopened = null; |
|
| 320 | 320 | |
| 321 | 321 | /** Optional. Service message: video chat scheduled */ |
| 322 | - public null|videoChatScheduled $video_chat_scheduled = null; |
|
| 322 | + public null | videoChatScheduled $video_chat_scheduled = null; |
|
| 323 | 323 | |
| 324 | 324 | /** Optional. Service message: video chat started */ |
| 325 | - public null|videoChatStarted $video_chat_started = null; |
|
| 325 | + public null | videoChatStarted $video_chat_started = null; |
|
| 326 | 326 | |
| 327 | 327 | /** Optional. Service message: video chat ended */ |
| 328 | - public null|videoChatEnded $video_chat_ended = null; |
|
| 328 | + public null | videoChatEnded $video_chat_ended = null; |
|
| 329 | 329 | |
| 330 | 330 | /** Optional. Service message: new participants invited to a video chat */ |
| 331 | - public null|videoChatParticipantsInvited $video_chat_participants_invited = null; |
|
| 331 | + public null | videoChatParticipantsInvited $video_chat_participants_invited = null; |
|
| 332 | 332 | |
| 333 | 333 | /** Optional. Service message: data sent by a Web App */ |
| 334 | - public null|webAppData $web_app_data = null; |
|
| 334 | + public null | webAppData $web_app_data = null; |
|
| 335 | 335 | |
| 336 | 336 | /** Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */ |
| 337 | - public null|inlineKeyboardMarkup $reply_markup = null; |
|
| 337 | + public null | inlineKeyboardMarkup $reply_markup = null; |
|
| 338 | 338 | |
| 339 | 339 | |
| 340 | - public function __construct(stdClass|null $object = null) { |
|
| 340 | + public function __construct(stdClass | null $object = null) { |
|
| 341 | 341 | if ($object != null) { |
| 342 | 342 | parent::__construct($object, self::subs); |
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - public function delete (): responseError|bool { |
|
| 347 | - return telegram::deleteMessage($this->chat->id,$this->id); |
|
| 346 | + public function delete(): responseError | bool { |
|
| 347 | + return telegram::deleteMessage($this->chat->id, $this->id); |
|
| 348 | 348 | } |
| 349 | 349 | } |
@@ -26,23 +26,23 @@ |
||
| 26 | 26 | public int $date; |
| 27 | 27 | |
| 28 | 28 | /** Optional. Bio of the user. */ |
| 29 | - public null|string $bio = null; |
|
| 29 | + public null | string $bio = null; |
|
| 30 | 30 | |
| 31 | 31 | /** Optional. Chat invite link that was used by the user to send the join request */ |
| 32 | - public null|chatInviteLink $invite_link = null; |
|
| 32 | + public null | chatInviteLink $invite_link = null; |
|
| 33 | 33 | |
| 34 | 34 | |
| 35 | - public function __construct(stdClass|null $object = null) { |
|
| 35 | + public function __construct(stdClass | null $object = null) { |
|
| 36 | 36 | if ($object != null) { |
| 37 | 37 | parent::__construct($object, self::subs); |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function accept(): responseError|bool { |
|
| 42 | - return telegram::approveChatJoinRequest($this->chat->id,$this->from->id); |
|
| 41 | + public function accept(): responseError | bool { |
|
| 42 | + return telegram::approveChatJoinRequest($this->chat->id, $this->from->id); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function deny(): responseError|bool { |
|
| 46 | - return telegram::declineChatJoinRequest($this->chat->id,$this->from->id); |
|
| 45 | + public function deny(): responseError | bool { |
|
| 46 | + return telegram::declineChatJoinRequest($this->chat->id, $this->from->id); |
|
| 47 | 47 | } |
| 48 | 48 | } |