@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * @internal Only for BPT self usage , Don't use it in your source! |
| 20 | 20 | */ |
| 21 | - public static function init(string $method,array $data) { |
|
| 21 | + public static function init(string $method, array $data) { |
|
| 22 | 22 | $info = self::getInfo($data); |
| 23 | 23 | $data = $info['data']; |
| 24 | 24 | $handler = $info['handler']; |
| 25 | - self::setTimeout($data,$handler,$method); |
|
| 25 | + self::setTimeout($data, $handler, $method); |
|
| 26 | 26 | self::setData($data); |
| 27 | 27 | $data['method'] = $method; |
| 28 | 28 | curl_setopt($handler, CURLOPT_POSTFIELDS, $data); |
| 29 | 29 | $result = curl_exec($handler); |
| 30 | 30 | if (curl_errno($handler)) { |
| 31 | - logger::write(curl_error($handler),loggerTypes::WARNING); |
|
| 31 | + logger::write(curl_error($handler), loggerTypes::WARNING); |
|
| 32 | 32 | } |
| 33 | 33 | if ($info['token'] != settings::$token) { |
| 34 | 34 | curl_close($handler); |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | curl_setopt($curl_handler, CURLOPT_RETURNTRANSFER, true); |
| 46 | 46 | curl_setopt($curl_handler, CURLOPT_SSL_VERIFYPEER, false); |
| 47 | 47 | } |
| 48 | - else{ |
|
| 48 | + else { |
|
| 49 | 49 | $token = settings::$token; |
| 50 | - if (!isset(self::$curl_handler)){ |
|
| 50 | + if (!isset(self::$curl_handler)) { |
|
| 51 | 51 | self::$curl_handler = curl_init(settings::$base_url."/bot$token/"); |
| 52 | 52 | curl_setopt(self::$curl_handler, CURLOPT_RETURNTRANSFER, true); |
| 53 | 53 | curl_setopt(self::$curl_handler, CURLOPT_SSL_VERIFYPEER, false); |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | ]; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - private static function setTimeout(array &$data , CurlHandle $curl_handler,string $method): void { |
|
| 66 | + private static function setTimeout(array &$data, CurlHandle $curl_handler, string $method): void { |
|
| 67 | 67 | if (isset($data['forgot'])) { |
| 68 | 68 | curl_setopt($curl_handler, CURLOPT_TIMEOUT_MS, settings::$forgot_time); |
| 69 | 69 | unset($data['forgot']); |
| 70 | 70 | } |
| 71 | - elseif ($method === 'getUpdates' || $method === 'setWebhook'){ |
|
| 71 | + elseif ($method === 'getUpdates' || $method === 'setWebhook') { |
|
| 72 | 72 | curl_setopt($curl_handler, CURLOPT_TIMEOUT_MS, 5000); |
| 73 | 73 | } |
| 74 | 74 | elseif (settings::$base_timeout > 0) { |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | private static function setData(array &$data): void { |
| 80 | - foreach ($data as &$value){ |
|
| 81 | - if (is_array($value) || (is_object($value) && !is_a($value,'CURLFile') && !($value instanceof types))){ |
|
| 80 | + foreach ($data as &$value) { |
|
| 81 | + if (is_array($value) || (is_object($value) && !is_a($value, 'CURLFile') && !($value instanceof types))) { |
|
| 82 | 82 | $value = json_encode($value); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | public int $message_id; |
| 85 | 85 | |
| 86 | 86 | /** Optional. Unique identifier of a message thread to which the message belongs; for supergroups only */ |
| 87 | - public null|int $message_thread_id = null; |
|
| 87 | + public null | int $message_thread_id = null; |
|
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field |
| 91 | 91 | * contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. |
| 92 | 92 | */ |
| 93 | - public null|user $from = null; |
|
| 93 | + public null | user $from = null; |
|
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | 96 | * Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, |
@@ -98,16 +98,16 @@ discard block |
||
| 98 | 98 | * automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake |
| 99 | 99 | * sender user in non-channel chats, if the message was sent on behalf of a chat. |
| 100 | 100 | */ |
| 101 | - public null|chat $sender_chat = null; |
|
| 101 | + public null | chat $sender_chat = null; |
|
| 102 | 102 | |
| 103 | 103 | /** Optional. If the sender of the message boosted the chat, the number of boosts added by the user */ |
| 104 | - public null|int $sender_boost_count = null; |
|
| 104 | + public null | int $sender_boost_count = null; |
|
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * Optional. The bot that actually sent the message on behalf of the business account. Available only for |
| 108 | 108 | * outgoing messages sent on behalf of the connected business account. |
| 109 | 109 | */ |
| 110 | - public null|user $sender_business_bot = null; |
|
| 110 | + public null | user $sender_business_bot = null; |
|
| 111 | 111 | |
| 112 | 112 | /** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */ |
| 113 | 113 | public int $date; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * message belongs to a chat of the corresponding business account that is independent from any potential bot |
| 118 | 118 | * chat which might share the same identifier. |
| 119 | 119 | */ |
| 120 | - public null|string $business_connection_id = null; |
|
| 120 | + public null | string $business_connection_id = null; |
|
| 121 | 121 | |
| 122 | 122 | /** Chat the message belongs to */ |
| 123 | 123 | public chat $chat; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * |
| 128 | 128 | * @deprecated used forward_origin instead |
| 129 | 129 | */ |
| 130 | - public null|user $forward_from = null; |
|
| 130 | + public null | user $forward_from = null; |
|
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | 133 | * Optional. For messages forwarded from channels or from anonymous administrators, information about the |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | * |
| 136 | 136 | * @deprecated used forward_origin instead |
| 137 | 137 | */ |
| 138 | - public null|chat $forward_from_chat = null; |
|
| 138 | + public null | chat $forward_from_chat = null; |
|
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | 141 | * Optional. For messages forwarded from channels, identifier of the original message in the channel |
| 142 | 142 | * |
| 143 | 143 | * @deprecated used forward_origin instead |
| 144 | 144 | */ |
| 145 | - public null|int $forward_from_message_id = null; |
|
| 145 | + public null | int $forward_from_message_id = null; |
|
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | 148 | * Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * |
| 151 | 151 | * @deprecated used forward_origin instead |
| 152 | 152 | */ |
| 153 | - public null|string $forward_signature = null; |
|
| 153 | + public null | string $forward_signature = null; |
|
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | 156 | * Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in |
@@ -158,206 +158,206 @@ discard block |
||
| 158 | 158 | * |
| 159 | 159 | * @deprecated used forward_origin instead |
| 160 | 160 | */ |
| 161 | - public null|string $forward_sender_name = null; |
|
| 161 | + public null | string $forward_sender_name = null; |
|
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | 164 | * Optional. For forwarded messages, date the original message was sent in Unix time |
| 165 | 165 | * @deprecated used forward_origin instead |
| 166 | 166 | */ |
| 167 | - public null|int $forward_date = null; |
|
| 167 | + public null | int $forward_date = null; |
|
| 168 | 168 | |
| 169 | 169 | /** Optional. Information about the original message for forwarded messages */ |
| 170 | - public null|messageOrigin $forward_origin = null; |
|
| 170 | + public null | messageOrigin $forward_origin = null; |
|
| 171 | 171 | |
| 172 | 172 | /** Optional. True, if the message is sent to a forum topic */ |
| 173 | - public null|bool $is_topic_message = null; |
|
| 173 | + public null | bool $is_topic_message = null; |
|
| 174 | 174 | |
| 175 | 175 | /** |
| 176 | 176 | * Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion |
| 177 | 177 | * group |
| 178 | 178 | */ |
| 179 | - public null|bool $is_automatic_forward = null; |
|
| 179 | + public null | bool $is_automatic_forward = null; |
|
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | 182 | * Optional. For replies in the same chat and message thread, the original message. Note that the Message object |
| 183 | 183 | * in this field will not contain further reply_to_message fields even if it itself is a reply. |
| 184 | 184 | */ |
| 185 | - public null|message $reply_to_message = null; |
|
| 185 | + public null | message $reply_to_message = null; |
|
| 186 | 186 | |
| 187 | 187 | /** |
| 188 | 188 | * Optional. Information about the message that is being replied to, which may come from another chat or forum |
| 189 | 189 | * topic |
| 190 | 190 | */ |
| 191 | - public null|externalReplyInfo $external_reply = null; |
|
| 191 | + public null | externalReplyInfo $external_reply = null; |
|
| 192 | 192 | |
| 193 | 193 | /** Optional. For replies that quote part of the original message, the quoted part of the message */ |
| 194 | - public null|textQuote $quote = null; |
|
| 194 | + public null | textQuote $quote = null; |
|
| 195 | 195 | |
| 196 | 196 | /** Optional. For replies to a story, the original story */ |
| 197 | - public null|story $reply_to_story = null; |
|
| 197 | + public null | story $reply_to_story = null; |
|
| 198 | 198 | |
| 199 | 199 | /** Optional. Bot through which the message was sent */ |
| 200 | - public null|user $via_bot = null; |
|
| 200 | + public null | user $via_bot = null; |
|
| 201 | 201 | |
| 202 | 202 | /** Optional. Date the message was last edited in Unix time */ |
| 203 | - public null|int $edit_date = null; |
|
| 203 | + public null | int $edit_date = null; |
|
| 204 | 204 | |
| 205 | 205 | /** Optional. True, if the message can't be forwarded */ |
| 206 | - public null|bool $has_protected_content = null; |
|
| 206 | + public null | bool $has_protected_content = null; |
|
| 207 | 207 | |
| 208 | 208 | /** |
| 209 | 209 | * Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business |
| 210 | 210 | * message, or as a scheduled message |
| 211 | 211 | */ |
| 212 | - public null|bool $is_from_offline = null; |
|
| 212 | + public null | bool $is_from_offline = null; |
|
| 213 | 213 | |
| 214 | 214 | /** Optional. The unique identifier of a media message group this message belongs to */ |
| 215 | - public null|string $media_group_id = null; |
|
| 215 | + public null | string $media_group_id = null; |
|
| 216 | 216 | |
| 217 | 217 | /** |
| 218 | 218 | * Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group |
| 219 | 219 | * administrator |
| 220 | 220 | */ |
| 221 | - public null|string $author_signature = null; |
|
| 221 | + public null | string $author_signature = null; |
|
| 222 | 222 | |
| 223 | 223 | /** Optional. For text messages, the actual UTF-8 text of the message */ |
| 224 | - public null|string $text = null; |
|
| 224 | + public null | string $text = null; |
|
| 225 | 225 | |
| 226 | 226 | /** Optional. If user message was a command , this parameter will be the command */ |
| 227 | - public string|null $command = null; |
|
| 227 | + public string | null $command = null; |
|
| 228 | 228 | |
| 229 | 229 | /** Optional. If user message was a command , this parameter will be the command username(if exist) */ |
| 230 | - public string|null $command_username = null; |
|
| 230 | + public string | null $command_username = null; |
|
| 231 | 231 | |
| 232 | 232 | /** Optional. If user message was a command , this parameter will be the command payload(if exist) */ |
| 233 | - public string|null $command_payload = null; |
|
| 233 | + public string | null $command_payload = null; |
|
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | 236 | * Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text |
| 237 | 237 | * @var messageEntity[] |
| 238 | 238 | */ |
| 239 | - public null|array $entities = null; |
|
| 239 | + public null | array $entities = null; |
|
| 240 | 240 | |
| 241 | 241 | /** |
| 242 | 242 | * Optional. Options used for link preview generation for the message, if it is a text message and link preview |
| 243 | 243 | * options were changed |
| 244 | 244 | */ |
| 245 | - public null|linkPreviewOptions $link_preview_options = null; |
|
| 245 | + public null | linkPreviewOptions $link_preview_options = null; |
|
| 246 | 246 | |
| 247 | 247 | /** Optional. Unique identifier of the message effect added to the message */ |
| 248 | - public null|string $effect_id = null; |
|
| 248 | + public null | string $effect_id = null; |
|
| 249 | 249 | |
| 250 | 250 | /** |
| 251 | 251 | * Optional. Message is an animation, information about the animation. For backward compatibility, when this |
| 252 | 252 | * field is set, the document field will also be set |
| 253 | 253 | */ |
| 254 | - public null|animation $animation = null; |
|
| 254 | + public null | animation $animation = null; |
|
| 255 | 255 | |
| 256 | 256 | /** Optional. Message is an audio file, information about the file */ |
| 257 | - public null|audio $audio = null; |
|
| 257 | + public null | audio $audio = null; |
|
| 258 | 258 | |
| 259 | 259 | /** Optional. Message is a general file, information about the file */ |
| 260 | - public null|document $document = null; |
|
| 260 | + public null | document $document = null; |
|
| 261 | 261 | |
| 262 | 262 | /** |
| 263 | 263 | * Optional. Message is a photo, available sizes of the photo |
| 264 | 264 | * @var photoSize[] |
| 265 | 265 | */ |
| 266 | - public null|array $photo = null; |
|
| 266 | + public null | array $photo = null; |
|
| 267 | 267 | |
| 268 | 268 | /** Optional. Message is a sticker, information about the sticker */ |
| 269 | - public null|sticker $sticker = null; |
|
| 269 | + public null | sticker $sticker = null; |
|
| 270 | 270 | |
| 271 | 271 | /** Optional. Message is a forwarded story */ |
| 272 | - public null|story $story = null; |
|
| 272 | + public null | story $story = null; |
|
| 273 | 273 | |
| 274 | 274 | /** Optional. Message is a video, information about the video */ |
| 275 | - public null|video $video = null; |
|
| 275 | + public null | video $video = null; |
|
| 276 | 276 | |
| 277 | 277 | /** Optional. Message is a video note, information about the video message */ |
| 278 | - public null|videoNote $video_note = null; |
|
| 278 | + public null | videoNote $video_note = null; |
|
| 279 | 279 | |
| 280 | 280 | /** Optional. Message is a voice message, information about the file */ |
| 281 | - public null|voice $voice = null; |
|
| 281 | + public null | voice $voice = null; |
|
| 282 | 282 | |
| 283 | 283 | /** Optional. Caption for the animation, audio, document, photo, video or voice */ |
| 284 | - public null|string $caption = null; |
|
| 284 | + public null | string $caption = null; |
|
| 285 | 285 | |
| 286 | 286 | /** |
| 287 | 287 | * Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear |
| 288 | 288 | * in the caption |
| 289 | 289 | * @var messageEntity[] |
| 290 | 290 | */ |
| 291 | - public null|array $caption_entities = null; |
|
| 291 | + public null | array $caption_entities = null; |
|
| 292 | 292 | |
| 293 | 293 | /** Optional. True, if the caption must be shown above the message media */ |
| 294 | - public null|bool $show_caption_above_media = null; |
|
| 294 | + public null | bool $show_caption_above_media = null; |
|
| 295 | 295 | |
| 296 | 296 | /** Optional. True, if the message media is covered by a spoiler animation */ |
| 297 | - public null|bool $has_media_spoiler = null; |
|
| 297 | + public null | bool $has_media_spoiler = null; |
|
| 298 | 298 | |
| 299 | 299 | /** Optional. Message is a shared contact, information about the contact */ |
| 300 | - public null|contact $contact = null; |
|
| 300 | + public null | contact $contact = null; |
|
| 301 | 301 | |
| 302 | 302 | /** Optional. Message is a dice with random value */ |
| 303 | - public null|dice $dice = null; |
|
| 303 | + public null | dice $dice = null; |
|
| 304 | 304 | |
| 305 | 305 | /** Optional. Message is a game, information about the game. More about games » */ |
| 306 | - public null|game $game = null; |
|
| 306 | + public null | game $game = null; |
|
| 307 | 307 | |
| 308 | 308 | /** Optional. Message is a native poll, information about the poll */ |
| 309 | - public null|poll $poll = null; |
|
| 309 | + public null | poll $poll = null; |
|
| 310 | 310 | |
| 311 | 311 | /** |
| 312 | 312 | * Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, |
| 313 | 313 | * the location field will also be set |
| 314 | 314 | */ |
| 315 | - public null|venue $venue = null; |
|
| 315 | + public null | venue $venue = null; |
|
| 316 | 316 | |
| 317 | 317 | /** Optional. Message is a shared location, information about the location */ |
| 318 | - public null|location $location = null; |
|
| 318 | + public null | location $location = null; |
|
| 319 | 319 | |
| 320 | 320 | /** |
| 321 | 321 | * Optional. New members that were added to the group or supergroup and information about them (the bot itself |
| 322 | 322 | * may be one of these members) |
| 323 | 323 | * @var user[] |
| 324 | 324 | */ |
| 325 | - public null|array $new_chat_members = null; |
|
| 325 | + public null | array $new_chat_members = null; |
|
| 326 | 326 | |
| 327 | 327 | /** Optional. A member was removed from the group, information about them (this member may be the bot itself) */ |
| 328 | - public null|user $left_chat_member = null; |
|
| 328 | + public null | user $left_chat_member = null; |
|
| 329 | 329 | |
| 330 | 330 | /** Optional. A chat title was changed to this value */ |
| 331 | - public null|string $new_chat_title = null; |
|
| 331 | + public null | string $new_chat_title = null; |
|
| 332 | 332 | |
| 333 | 333 | /** |
| 334 | 334 | * Optional. A chat photo was change to this value |
| 335 | 335 | * @var photoSize[] |
| 336 | 336 | */ |
| 337 | - public null|array $new_chat_photo = null; |
|
| 337 | + public null | array $new_chat_photo = null; |
|
| 338 | 338 | |
| 339 | 339 | /** Optional. Service message: the chat photo was deleted */ |
| 340 | - public null|bool $delete_chat_photo = null; |
|
| 340 | + public null | bool $delete_chat_photo = null; |
|
| 341 | 341 | |
| 342 | 342 | /** Optional. Service message: the group has been created */ |
| 343 | - public null|bool $group_chat_created = null; |
|
| 343 | + public null | bool $group_chat_created = null; |
|
| 344 | 344 | |
| 345 | 345 | /** |
| 346 | 346 | * Optional. Service message: the supergroup has been created. This field can't be received in a message coming |
| 347 | 347 | * through updates, because bot can't be a member of a supergroup when it is created. It can only be found in |
| 348 | 348 | * reply_to_message if someone replies to a very first message in a directly created supergroup. |
| 349 | 349 | */ |
| 350 | - public null|bool $supergroup_chat_created = null; |
|
| 350 | + public null | bool $supergroup_chat_created = null; |
|
| 351 | 351 | |
| 352 | 352 | /** |
| 353 | 353 | * Optional. Service message: the channel has been created. This field can't be received in a message coming |
| 354 | 354 | * through updates, because bot can't be a member of a channel when it is created. It can only be found in |
| 355 | 355 | * reply_to_message if someone replies to a very first message in a channel. |
| 356 | 356 | */ |
| 357 | - public null|bool $channel_chat_created = null; |
|
| 357 | + public null | bool $channel_chat_created = null; |
|
| 358 | 358 | |
| 359 | 359 | /** Optional. Service message: auto-delete timer settings changed in the chat */ |
| 360 | - public null|messageAutoDeleteTimerChanged $message_auto_delete_timer_changed = null; |
|
| 360 | + public null | messageAutoDeleteTimerChanged $message_auto_delete_timer_changed = null; |
|
| 361 | 361 | |
| 362 | 362 | /** |
| 363 | 363 | * Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for |
| 366 | 366 | * storing this identifier. |
| 367 | 367 | */ |
| 368 | - public null|int $migrate_to_chat_id = null; |
|
| 368 | + public null | int $migrate_to_chat_id = null; |
|
| 369 | 369 | |
| 370 | 370 | /** |
| 371 | 371 | * Optional. The supergroup has been migrated from a group with the specified identifier. This number may have |
@@ -373,25 +373,25 @@ discard block |
||
| 373 | 373 | * interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float |
| 374 | 374 | * type are safe for storing this identifier. |
| 375 | 375 | */ |
| 376 | - public null|int $migrate_from_chat_id = null; |
|
| 376 | + public null | int $migrate_from_chat_id = null; |
|
| 377 | 377 | |
| 378 | 378 | /** |
| 379 | 379 | * Optional. Specified message was pinned. Note that the Message object in this field will not contain further |
| 380 | 380 | * reply_to_message fields even if it itself is a reply. |
| 381 | 381 | */ |
| 382 | - public null|maybeInaccessibleMessage $pinned_message = null; |
|
| 382 | + public null | maybeInaccessibleMessage $pinned_message = null; |
|
| 383 | 383 | |
| 384 | 384 | /** Optional. Message is an invoice for a payment, information about the invoice. More about payments » */ |
| 385 | - public null|invoice $invoice = null; |
|
| 385 | + public null | invoice $invoice = null; |
|
| 386 | 386 | |
| 387 | 387 | /** |
| 388 | 388 | * Optional. Message is a service message about a successful payment, information about the payment. More about |
| 389 | 389 | * payments » |
| 390 | 390 | */ |
| 391 | - public null|successfulPayment $successful_payment = null; |
|
| 391 | + public null | successfulPayment $successful_payment = null; |
|
| 392 | 392 | |
| 393 | 393 | /** Optional. Service message: users were shared with the bot */ |
| 394 | - public null|usersShared $users_shared = null; |
|
| 394 | + public null | usersShared $users_shared = null; |
|
| 395 | 395 | |
| 396 | 396 | /** |
| 397 | 397 | * Optional. Service message: a user was shared with the bot |
@@ -400,86 +400,86 @@ discard block |
||
| 400 | 400 | * |
| 401 | 401 | * @deprecated use users_shared instead |
| 402 | 402 | */ |
| 403 | - public null|userShared $user_shared = null; |
|
| 403 | + public null | userShared $user_shared = null; |
|
| 404 | 404 | |
| 405 | 405 | /** Optional. Service message: a chat was shared with the bot */ |
| 406 | - public null|chatShared $chat_shared = null; |
|
| 406 | + public null | chatShared $chat_shared = null; |
|
| 407 | 407 | |
| 408 | 408 | /** Optional. The domain name of the website on which the user has logged in. More about Telegram Login » */ |
| 409 | - public null|string $connected_website = null; |
|
| 409 | + public null | string $connected_website = null; |
|
| 410 | 410 | |
| 411 | 411 | /** |
| 412 | 412 | * Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or |
| 413 | 413 | * side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method |
| 414 | 414 | * requestWriteAccess |
| 415 | 415 | */ |
| 416 | - public null|writeAccessAllowed $write_access_allowed = null; |
|
| 416 | + public null | writeAccessAllowed $write_access_allowed = null; |
|
| 417 | 417 | |
| 418 | 418 | /** Optional. Telegram Passport data */ |
| 419 | - public null|passportData $passport_data = null; |
|
| 419 | + public null | passportData $passport_data = null; |
|
| 420 | 420 | |
| 421 | 421 | /** |
| 422 | 422 | * Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live |
| 423 | 423 | * Location. |
| 424 | 424 | */ |
| 425 | - public null|proximityAlertTriggered $proximity_alert_triggered = null; |
|
| 425 | + public null | proximityAlertTriggered $proximity_alert_triggered = null; |
|
| 426 | 426 | |
| 427 | 427 | /** Optional. Service message: user boosted the chat */ |
| 428 | - public null|chatBoostAdded $boost_added = null; |
|
| 428 | + public null | chatBoostAdded $boost_added = null; |
|
| 429 | 429 | |
| 430 | 430 | /** Optional. Service message: chat background set */ |
| 431 | - public null|chatBackground $chat_background_set = null; |
|
| 431 | + public null | chatBackground $chat_background_set = null; |
|
| 432 | 432 | |
| 433 | 433 | /** Optional. Service message: forum topic created */ |
| 434 | - public null|forumTopicCreated $forum_topic_created = null; |
|
| 434 | + public null | forumTopicCreated $forum_topic_created = null; |
|
| 435 | 435 | |
| 436 | 436 | /** Optional. Service message: forum topic edited */ |
| 437 | - public null|forumTopicEdited $forum_topic_edited = null; |
|
| 437 | + public null | forumTopicEdited $forum_topic_edited = null; |
|
| 438 | 438 | |
| 439 | 439 | /** Optional. Service message: forum topic closed */ |
| 440 | - public null|forumTopicClosed $forum_topic_closed = null; |
|
| 440 | + public null | forumTopicClosed $forum_topic_closed = null; |
|
| 441 | 441 | |
| 442 | 442 | /** Optional. Service message: forum topic reopened */ |
| 443 | - public null|forumTopicReopened $forum_topic_reopened = null; |
|
| 443 | + public null | forumTopicReopened $forum_topic_reopened = null; |
|
| 444 | 444 | |
| 445 | 445 | /** Optional. Service message: the 'General' forum topic hidden */ |
| 446 | - public null|generalForumTopicHidden $general_forum_topic_hidden = null; |
|
| 446 | + public null | generalForumTopicHidden $general_forum_topic_hidden = null; |
|
| 447 | 447 | |
| 448 | 448 | /** Optional. Service message: the 'General' forum topic unhidden */ |
| 449 | - public null|generalForumTopicUnhidden $general_forum_topic_unhidden = null; |
|
| 449 | + public null | generalForumTopicUnhidden $general_forum_topic_unhidden = null; |
|
| 450 | 450 | |
| 451 | 451 | /** Optional. Service message: a scheduled giveaway was created */ |
| 452 | - public null|giveawayCreated $giveaway_created = null; |
|
| 452 | + public null | giveawayCreated $giveaway_created = null; |
|
| 453 | 453 | |
| 454 | 454 | /** Optional. The message is a scheduled giveaway message */ |
| 455 | - public null|giveaway $giveaway = null; |
|
| 455 | + public null | giveaway $giveaway = null; |
|
| 456 | 456 | |
| 457 | 457 | /** Optional. A giveaway with public winners was completed */ |
| 458 | - public null|giveawayWinners $giveaway_winners = null; |
|
| 458 | + public null | giveawayWinners $giveaway_winners = null; |
|
| 459 | 459 | |
| 460 | 460 | /** Optional. Service message: a giveaway without public winners was completed */ |
| 461 | - public null|giveawayCompleted $giveaway_completed = null; |
|
| 461 | + public null | giveawayCompleted $giveaway_completed = null; |
|
| 462 | 462 | |
| 463 | 463 | /** Optional. Service message: video chat scheduled */ |
| 464 | - public null|videoChatScheduled $video_chat_scheduled = null; |
|
| 464 | + public null | videoChatScheduled $video_chat_scheduled = null; |
|
| 465 | 465 | |
| 466 | 466 | /** Optional. Service message: video chat started */ |
| 467 | - public null|videoChatStarted $video_chat_started = null; |
|
| 467 | + public null | videoChatStarted $video_chat_started = null; |
|
| 468 | 468 | |
| 469 | 469 | /** Optional. Service message: video chat ended */ |
| 470 | - public null|videoChatEnded $video_chat_ended = null; |
|
| 470 | + public null | videoChatEnded $video_chat_ended = null; |
|
| 471 | 471 | |
| 472 | 472 | /** Optional. Service message: new participants invited to a video chat */ |
| 473 | - public null|videoChatParticipantsInvited $video_chat_participants_invited = null; |
|
| 473 | + public null | videoChatParticipantsInvited $video_chat_participants_invited = null; |
|
| 474 | 474 | |
| 475 | 475 | /** Optional. Service message: data sent by a Web App */ |
| 476 | - public null|webAppData $web_app_data = null; |
|
| 476 | + public null | webAppData $web_app_data = null; |
|
| 477 | 477 | |
| 478 | 478 | /** Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */ |
| 479 | - public null|inlineKeyboardMarkup $reply_markup = null; |
|
| 479 | + public null | inlineKeyboardMarkup $reply_markup = null; |
|
| 480 | 480 | |
| 481 | 481 | |
| 482 | - public function __construct(stdClass|null $object = null) { |
|
| 482 | + public function __construct(stdClass | null $object = null) { |
|
| 483 | 483 | if ($object != null) { |
| 484 | 484 | parent::__construct($object, self::subs); |
| 485 | 485 | |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | * |
| 492 | 492 | * @return bool |
| 493 | 493 | */ |
| 494 | - public function isMedia (): bool { |
|
| 494 | + public function isMedia(): bool { |
|
| 495 | 495 | return isset($this->animation) || isset($this->audio) || isset($this->document) || isset($this->video) || |
| 496 | 496 | isset($this->photo) || isset($this->voice) || isset($this->video_note) || isset($this->sticker); |
| 497 | 497 | } |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | * |
| 502 | 502 | * @return bool |
| 503 | 503 | */ |
| 504 | - public function isCommand (): bool { |
|
| 504 | + public function isCommand(): bool { |
|
| 505 | 505 | return !empty($this->command); |
| 506 | 506 | } |
| 507 | 507 | |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | * |
| 511 | 511 | * @return bool |
| 512 | 512 | */ |
| 513 | - public function isForwarded (): bool { |
|
| 513 | + public function isForwarded(): bool { |
|
| 514 | 514 | return $this->forward_origin !== null; |
| 515 | 515 | } |
| 516 | 516 | |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | * |
| 520 | 520 | * @return bool |
| 521 | 521 | */ |
| 522 | - public function isReplied (): bool { |
|
| 522 | + public function isReplied(): bool { |
|
| 523 | 523 | return !empty($this->reply_to_message); |
| 524 | 524 | } |
| 525 | 525 | |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | * |
| 531 | 531 | * @return bool |
| 532 | 532 | */ |
| 533 | - public function isAdmin (): bool { |
|
| 533 | + public function isAdmin(): bool { |
|
| 534 | 534 | return $this->chat->getMember($this->from->id)->status === chatMemberStatus::ADMINISTRATOR; |
| 535 | 535 | } |
| 536 | 536 | |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | * |
| 542 | 542 | * @return bool |
| 543 | 543 | */ |
| 544 | - public function isOwner (): bool { |
|
| 544 | + public function isOwner(): bool { |
|
| 545 | 545 | return $this->chat->getMember($this->from->id)->status === chatMemberStatus::CREATOR; |
| 546 | 546 | } |
| 547 | 547 | |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | * |
| 555 | 555 | * @return responseError|bool |
| 556 | 556 | */ |
| 557 | - public function banMember(bool $answer = null): responseError|bool { |
|
| 557 | + public function banMember(bool $answer = null): responseError | bool { |
|
| 558 | 558 | if ($this->chat->isPrivate()) { |
| 559 | 559 | return false; |
| 560 | 560 | } |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | * |
| 571 | 571 | * @return responseError|bool |
| 572 | 572 | */ |
| 573 | - public function kickMember(bool $answer = null): responseError|bool { |
|
| 573 | + public function kickMember(bool $answer = null): responseError | bool { |
|
| 574 | 574 | if ($this->chat->isPrivate()) { |
| 575 | 575 | return false; |
| 576 | 576 | } |
@@ -584,8 +584,8 @@ discard block |
||
| 584 | 584 | * |
| 585 | 585 | * @return responseError|bool |
| 586 | 586 | */ |
| 587 | - public function delete (bool $answer = null): responseError|bool { |
|
| 588 | - return telegram::deleteMessage($this->chat->id,$this->id, answer: $answer); |
|
| 587 | + public function delete(bool $answer = null): responseError | bool { |
|
| 588 | + return telegram::deleteMessage($this->chat->id, $this->id, answer: $answer); |
|
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | /** |
@@ -595,8 +595,8 @@ discard block |
||
| 595 | 595 | * |
| 596 | 596 | * @return responseError|bool |
| 597 | 597 | */ |
| 598 | - public function pinChatMessage (bool $answer = null): responseError|bool { |
|
| 599 | - return telegram::deleteMessage($this->chat->id,$this->id, answer: $answer); |
|
| 598 | + public function pinChatMessage(bool $answer = null): responseError | bool { |
|
| 599 | + return telegram::deleteMessage($this->chat->id, $this->id, answer: $answer); |
|
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | /** |
@@ -607,8 +607,8 @@ discard block |
||
| 607 | 607 | * |
| 608 | 608 | * @return message|responseError|bool |
| 609 | 609 | */ |
| 610 | - public function editText (string $text, bool $answer = null): message|responseError|bool { |
|
| 611 | - return telegram::editMessageText($text, $this->chat->id, $this->message_id, answer: $answer); |
|
| 610 | + public function editText(string $text, bool $answer = null): message | responseError | bool { |
|
| 611 | + return telegram::editMessageText($text, $this->chat->id, $this->message_id, answer: $answer); |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | /** |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | * |
| 620 | 620 | * @return messageId|responseError |
| 621 | 621 | */ |
| 622 | - public function copy (int|string $chat_id, bool $answer = null): messageId|responseError { |
|
| 622 | + public function copy(int | string $chat_id, bool $answer = null): messageId | responseError { |
|
| 623 | 623 | return telegram::copyMessage($chat_id, answer: $answer); |
| 624 | 624 | } |
| 625 | 625 | |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | * |
| 632 | 632 | * @return message|responseError |
| 633 | 633 | */ |
| 634 | - public function forward (int|string $chat_id, bool $answer = null): message|responseError { |
|
| 634 | + public function forward(int | string $chat_id, bool $answer = null): message | responseError { |
|
| 635 | 635 | return telegram::forwardMessage($chat_id, answer: $answer); |
| 636 | 636 | } |
| 637 | 637 | } |