diff --git a/README.md b/README.md
index 8c2804be9..60b366b41 100644
--- a/README.md
+++ b/README.md
@@ -162,6 +162,7 @@ Some of MadelineProto's core components are also available as separate, standalo
* [danog\MadelineProto\EventHandler\Message\Service\DialogGameScore »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogGameScore.html) - Someone scored in a game.
* [danog\MadelineProto\EventHandler\Message\Service\DialogGeoProximityReached »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogGeoProximityReached.html) - A user of the chat is now in proximity of another user.
* [danog\MadelineProto\EventHandler\Message\Service\DialogGiftPremium »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogGiftPremium.html) - Info about a gifted Telegram Premium subscription.
+ * [danog\MadelineProto\EventHandler\Message\Service\DialogGiftStars »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogGiftStars.html) - Info about a gifted Telegram Stars.
* [danog\MadelineProto\EventHandler\Message\Service\DialogGroupCall »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogGroupCall.html) - Represents a service message about a group call.
* [danog\MadelineProto\EventHandler\Message\Service\DialogGroupCall\GroupCall »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogGroupCall/GroupCall.html) - The group call has started or ended.
* [danog\MadelineProto\EventHandler\Message\Service\DialogGroupCall\GroupCallInvited »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogGroupCall/GroupCallInvited.html) - A set of users was invited to the group call.
@@ -179,11 +180,13 @@ Some of MadelineProto's core components are also available as separate, standalo
* [danog\MadelineProto\EventHandler\Message\Service\DialogSetChatTheme »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogSetChatTheme.html) - The chat theme was changed.
* [danog\MadelineProto\EventHandler\Message\Service\DialogSetChatWallPaper »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogSetChatWallPaper.html) - The [wallpaper](https://core.telegram.org/api/wallpapers) of the current chat was changed.
* [danog\MadelineProto\EventHandler\Message\Service\DialogSetTTL »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogSetTTL.html) - The Time-To-Live of messages in this chat was changed.
+ * [danog\MadelineProto\EventHandler\Message\Service\DialogStarGift »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogStarGift.html) - Info about a Star gifted.
* [danog\MadelineProto\EventHandler\Message\Service\DialogSuggestProfilePhoto »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogSuggestProfilePhoto.html) - A new profile picture was suggested using [photos.uploadContactProfilePhoto](https://docs.madelineproto.xyz/API_docs/methods/photos.uploadContactProfilePhoto.html).
* [danog\MadelineProto\EventHandler\Message\Service\DialogTitleChanged »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogTitleChanged.html) - The title of a channel or group has changed.
* [danog\MadelineProto\EventHandler\Message\Service\DialogTopicCreated »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogTopicCreated.html) - A [forum topic](https://core.telegram.org/api/forum#forum-topics) was created.
* [danog\MadelineProto\EventHandler\Message\Service\DialogTopicEdited »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogTopicEdited.html) - [Forum topic](https://core.telegram.org/api/forum#forum-topics) information was edited.
* [danog\MadelineProto\EventHandler\Message\Service\DialogWebView »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message/Service/DialogWebView.html) - Data from an opened [reply keyboard bot web app](https://core.telegram.org/api/bots/webapps) was relayed to the bot that owns it (user & bot side service message).
+ * [danog\MadelineProto\EventHandler\Payments\Payment »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Payments/Payment.html) - This object contains information about an incoming pre-checkout query.
* [danog\MadelineProto\EventHandler\Pinned »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Pinned.html) - Indicates that some messages were pinned/unpinned.
* [danog\MadelineProto\EventHandler\Pinned\PinnedChannelMessages »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Pinned/PinnedChannelMessages.html) - Represents messages that were pinned/unpinned in a [channel](https://core.telegram.org/api/channel).
* [danog\MadelineProto\EventHandler\Pinned\PinnedGroupMessages »](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Pinned/PinnedGroupMessages.html) - Represents messages that were pinned/unpinned in a [chat/supergroup](https://core.telegram.org/api/channel).
@@ -569,7 +572,6 @@ Some of MadelineProto's core components are also available as separate, standalo
* Get a list of default suggested channel emoji statuses: account.getChannelDefaultEmojiStatuses
* Get a list of default suggested emoji statuses: account.getDefaultEmojiStatuses
* Get a list of peers that can be used to join a group call, presenting yourself as a specific user/channel: phone.getGroupCallJoinAs
- * Get a list of sponsored messages: channels.getSponsoredMessages
* Get a message to show to the user when starting the bot: getWebMessage
* Get a payment form: payments.getPaymentForm
* Get a set of suggested custom emoji stickers that can be used as group picture: account.getDefaultGroupPhotoEmojis
@@ -747,7 +749,6 @@ Some of MadelineProto's core components are also available as separate, standalo
* Informs server about a purchase made through the App Store: for official applications only: payments.assignAppStoreTransaction
* Informs server about a purchase made through the Play Store: for official applications only: payments.assignPlayMarketTransaction
* Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only: help.setBotUpdatesStatus
- * Informs the server that the user has either:: channels.clickSponsoredMessage
* Initialize a takeout session, see here » for more info: account.initTakeoutSession
* Initialize connection: initConnection
* Initialize self-restart hack: initSelfRestart
@@ -794,7 +795,6 @@ Some of MadelineProto's core components are also available as separate, standalo
* Manually convert HTML to a message and a set of entities: htmlToMessageEntities
* Manually convert markdown to a message and a set of entities: markdownToMessageEntities
* Manually mark dialog as unread: messages.markDialogUnread
- * Mark a specific sponsored message as read: channels.viewSponsoredMessage
* Mark a thread as read: messages.readDiscussion
* Mark all stories up to a certain ID as read, for a given peer; will emit an updateReadStories update to all logged-in sessions: stories.readStories
* Mark channel/supergroup history as read: channels.readHistory
@@ -1116,13 +1116,15 @@ Some of MadelineProto's core components are also available as separate, standalo
* auth.reportMissingCode
* base64URL decode: base64urlDecode
* bots.addPreviewMedia
+ * bots.checkDownloadFileParams
* bots.deletePreviewMedia
* bots.editPreviewMedia
* bots.getPopularAppBots
* bots.getPreviewInfo
* bots.getPreviewMedias
* bots.reorderPreviewMedias
- * channels.reportSponsoredMessage
+ * bots.toggleUserEmojiStatusPermission
+ * bots.updateUserEmojiStatus
* channels.restrictSponsoredMessages
* channels.searchPosts
* channels.setBoostsToUnblockRestrictions
@@ -1134,6 +1136,7 @@ Some of MadelineProto's core components are also available as separate, standalo
* invokeWithBusinessConnection
* invokeWithGooglePlayIntegrity
* messages.checkQuickReplyShortcut
+ * messages.clickSponsoredMessage
* messages.deleteFactCheck
* messages.deleteQuickReplyMessages
* messages.deleteQuickReplyShortcut
@@ -1146,18 +1149,24 @@ Some of MadelineProto's core components are also available as separate, standalo
* messages.getMyStickers
* messages.getOutboxReadDate
* messages.getPaidReactionPrivacy
+ * messages.getPreparedInlineMessage
* messages.getQuickReplies
* messages.getQuickReplyMessages
* messages.getSavedReactionTags
+ * messages.getSponsoredMessages
* messages.reorderQuickReplies
+ * messages.reportSponsoredMessage
* messages.requestMainWebView
+ * messages.savePreparedInlineMessage
* messages.sendPaidReaction
* messages.sendQuickReplyMessages
* messages.toggleDialogFilterTags
* messages.togglePaidReactionPrivacy
* messages.updateSavedReactionTag
+ * messages.viewSponsoredMessage
* null-byte RLE decode: rleDecode
* null-byte RLE encode: rleEncode
+ * payments.botCancelStarsSubscription
* payments.changeStarsSubscription
* payments.convertStarGift
* payments.fulfillStarsSubscription
diff --git a/composer.json b/composer.json
index d42eb7c3b..83139d406 100644
--- a/composer.json
+++ b/composer.json
@@ -36,13 +36,13 @@
"amphp/amp": "^3.0.2",
"amphp/http-client": "^5.1.0",
"amphp/websocket-client": "^2",
- "amphp/http": "^2.1.1",
+ "amphp/http": "^2.1.2",
"amphp/socket": "^2.3.1",
"amphp/dns": "^2.2.0",
"amphp/byte-stream": "^2.1.1",
"amphp/file": "^3.1.1",
"amphp/mysql": "^3",
- "amphp/postgres": "^2",
+ "amphp/postgres": "^2.1.1",
"danog/dns-over-https": "^1",
"amphp/http-client-cookies": "^2",
"danog/tg-file-decoder": "^1.0.1",
@@ -55,8 +55,8 @@
"psr/http-factory": "^1.1.0",
"psr/log": "^3.0.2",
"webmozart/assert": "^1.11",
- "bacon/bacon-qr-code": "^3",
- "nikic/php-parser": "^5.2.0",
+ "bacon/bacon-qr-code": "^3.0.1",
+ "nikic/php-parser": "^5.3.1",
"revolt/event-loop": "^1.0.6",
"danog/async-orm": "^1.1.0",
"danog/telegram-entities": "^1.0.4",
@@ -70,7 +70,7 @@
"phpunit/phpunit": "^9.6.21",
"amphp/phpunit-util": "^3",
"bamarni/composer-bin-plugin": "1.8.2",
- "symfony/yaml": "^6.4.12",
+ "symfony/yaml": "^6.4.13",
"revolt/event-loop-adapter-react": "^1.1.1",
"dg/bypass-finals": "dev-master",
"brianium/paratest": "^6.11.1",
diff --git a/docs b/docs
index 954549439..6df8ad8cf 160000
--- a/docs
+++ b/docs
@@ -1 +1 @@
-Subproject commit 9545494397382ac8ebc073fc9e74fc97451f5fb0
+Subproject commit 6df8ad8cf2859557125197b1c467ea667f1fbef4
diff --git a/langs/ru.json b/langs/ru.json
index 49dbda17f..9170a902d 100644
--- a/langs/ru.json
+++ b/langs/ru.json
@@ -91,5 +91,44 @@
"login_code_sending": "Отправка кода...",
"login_code_sent": "Код успешно отправлен! Как только Вы получите код Вам нужно использовать функцию completePhoneLogin.",
"login_2fa_enabled": "2FA активно, вам необходимо сначала вызвать функцию complete2falogin...",
- "not_loggedIn": "Я вошёл в систему!"
+ "not_loggedIn": "Я вошёл в систему!",
+ "call_error_1": "Не смог найти и принять звонок %s",
+ "string_required": "Ожидана string!",
+ "waveform_must_have_100_values": "Массив waveform должен иметь 100 значений!",
+ "waveform_value": "Значение waveform должно быть между 0 и 31!",
+ "method_not_found": "Невозможно найти метод: ",
+ "params_missing": "Не хватает необходимого папаметра",
+ "sec_peer_not_in_db": "Этого секретного чата нету во внутренней базе",
+ "length_too_big": "Длина слишком большая",
+ "login_user": "Вхожу как пользователь...",
+ "signup_ok": "Запись прошла успешно!",
+ "accepting_call": "Принимяю звонок от %s...",
+ "call_already_declined": "Звонок %s уже был отвергнут",
+ "call_error_3": "Невозможно найти и подтвердить звонок %s",
+ "call_completing": "Финализирую звонок от %s...",
+ "fingerprint_invalid": "Невалидный фингерпринт ключа!",
+ "file_parsing": "Чтение %s...",
+ "src_file_invalid": "Невалидный файл: ",
+ "bool_error": "Невозможно считать boolean",
+ "not_numeric": "Данное значение не цифра",
+ "long_not_32": "Длинна данного значения не равна 32 байтам",
+ "array_invalid": "Вы указали невалидный массив",
+ "predicate_not_set": "Предикат (значение под ключом _) не был указан!",
+ "login_bot": "Вхожу как бот...",
+ "login_need_signup": "На этот номер телефона не найдена учётная запись Телеграм...",
+ "long_not_16": "Длинна данного значения не равна 16 байтам",
+ "signup_uncalled": "Я не в процессе записи! Пожалуйста, вызовите сначала методы phoneLogin и completePhoneLogin!",
+ "2fa_uncalled": "Я не жду сейчас пароля! Вызовите сначала методы phoneLogin и completePhoneLogin!",
+ "call_already_accepted": "Звонок %s уже был принят",
+ "call_error_2": "Невозможно найти и подтвердить звонок %s",
+ "call_confirming": "Подтверждаю звонок от %s...",
+ "translate_madelineproto_cli": "MadelineProto можно локализировать на ваш язык (на данный момент переведено: %d%%), откройте https://weblate.madelineproto.xyz чтобы помочь с переводом!",
+ "translate_madelineproto_web": "MadelineProto можно локализировать на ваш язык (на данный момент переведено: %d%%), кликните сюда чтобы помочь с переводом!",
+ "peer_not_in_db": "Этот peer не находится во внутренней базе",
+ "call_discarding": "Отвергаю звонок %s...",
+ "stream_handle_invalid": "Использован невалидный стрим.",
+ "long_not_64": "Длинна данного значения не равна 64 байтам",
+ "update_madelineproto": "Вы используете старую версию MadelineProto, необходимо обновится: сейчас используется версия %s, но последняя версия со многими поправками и с новым функционалом - %s!",
+ "type_extract_error": "Невозможно распаковать тип \"%s\", необходимо обновить MadelineProto!",
+ "could_not_convert_object": "Невозможно сконвертировать объект типа %s"
}
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index 370257444..15a597f99 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -1,5 +1,5 @@
-
+
@@ -267,9 +267,6 @@
-
- $key]]]>
-
@@ -301,7 +298,6 @@
-
@@ -373,7 +369,6 @@
- $key]]]>
$session['auth_key']]]]>
@@ -382,7 +377,6 @@
-
@@ -555,14 +549,11 @@
-
-
-
@@ -586,7 +577,6 @@
-
@@ -1582,6 +1572,19 @@
+
+
+ entities]]>
+ entities]]>
+
+
+ getName()]]]>
+
+
+
+
+
+
wrapMessage($client->extractMessage($result))]]>
@@ -1807,6 +1810,68 @@
viewMessages]]>
+
+
+
+
+
+
+
+ currency]]>
+ payload]]>
+ queryId]]>
+ shippingOptionId]]>
+ totalAmount]]>
+ userId]]>
+
+
+ getClient()->methodCallAsyncRead(
+ 'messages.setBotPrecheckoutResults',
+ [
+ 'success' => false,
+ 'query_id' => $this->queryId,
+ 'error' => $errorMessage,
+ ]
+ )]]>
+ getClient()->methodCallAsyncRead(
+ 'messages.setBotPrecheckoutResults',
+ [
+ 'success' => true,
+ 'query_id' => $this->queryId,
+ ]
+ )]]>
+
+
+
+
+ getName()]]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ availabilityRemains]]>
+ availabilityTotal]]>
+ convertStars]]>
+ endSell]]>
+ id]]>
+ limited]]>
+ soldOut]]>
+ stars]]>
+ startSell]]>
+
+
ids]]>
@@ -2313,6 +2378,10 @@
+
+
+
+
@@ -2436,6 +2505,9 @@
+
+
+
@@ -2466,7 +2538,6 @@
-
@@ -2585,7 +2656,6 @@
- stdoutUnbuffered->getResource()]]>
optional]]>
optional]]>
optional]]>
+ stdoutUnbuffered->getResource()]]>
@@ -2634,9 +2705,6 @@
-
-
-
@@ -3269,8 +3337,6 @@
datacenter]]>
- authorization['hint']]]>
- authorization['hint']]]>
authorization['user'] ?? false]]>
authorization['user'] ?? false]]>
authorization['user']['bot']]]>
@@ -3286,7 +3352,6 @@
]]>
- authorization['hint']]]>
authorization['user']['bot']]]>
@@ -3304,7 +3369,6 @@
- authorization['hint']]]>
authorization['hint']]]>
authorization['user']]]>
authorization['user']]]>
@@ -3347,22 +3411,12 @@
-
-
-
-
-
-
- authKey]]>
- id]]>
- serverSalt]]>
-
@@ -3374,7 +3428,47 @@
content[self::RESPONSE_ID_MAP[$this->content['_']]]]]>
+
+
+ true,
+ 'rpc_answer_unknown' => true,
+ 'rpc_answer_dropped_running' => true,
+ 'rpc_answer_dropped' => true,
+ 'get_future_salts' => true,
+ 'future_salt' => true,
+ 'future_salts' => true,
+ 'ping' => true,
+ 'pong' => true,
+ 'ping_delay_disconnect' => true,
+ 'destroy_session' => true,
+ 'destroy_session_ok' => true,
+ 'destroy_session_none' => true,
+ //'new_session_created' => true,
+ 'msg_container' => true,
+ 'msg_copy' => true,
+ 'gzip_packed' => true,
+ 'http_wait' => true,
+ 'msgs_ack' => true,
+ 'bad_msg_notification' => true,
+ 'bad_server_salt' => true,
+ 'msgs_state_req' => true,
+ 'msgs_state_info' => true,
+ 'msgs_all_info' => true,
+ 'msg_detailed_info' => true,
+ 'msg_new_detailed_info' => true,
+ 'msg_resend_req' => true,
+ 'msg_resend_ans_req' => true,
+ ]]]>
+
+
+
+
+
+
+
+
@@ -4036,9 +4130,6 @@
write[$offset]->getFuture()->await($this->cancellation)]]>
-
-
-
read[$offset]]]>
write[$offset]]]>
@@ -4385,6 +4476,8 @@
+
+
pendingDb]]>
@@ -4651,7 +4744,6 @@
-
getIdInternal($id)]]>
getIdInternal($id)]]>
peerDatabase->getFull($partial['bot_api_id'])]]>
@@ -4879,6 +4971,8 @@
+
+
@@ -4888,17 +4982,23 @@
+
+
+
+
+
+
@@ -4957,14 +5057,20 @@
+
+
+
+
+
+
@@ -4973,20 +5079,30 @@
+
+
+
+
+
+
+
+
+
+
@@ -4996,6 +5112,7 @@
+
@@ -5155,7 +5272,6 @@
getIdInternal($message['action']['from_id'])]]>
getIdInternal($message['action']['to_id'])]]>
- webhookUrl]]>
authorization['user']]]>
@@ -5198,6 +5314,9 @@
+
+
+
@@ -5420,6 +5539,105 @@
+
+ true,
+ 'BOT_POLLS_DISABLED' => true,
+ 'PHOTO_THUMB_URL_INVALID' => true,
+ 'ACTIVE_USER_REQUIRED' => true,
+ 'PEER_FLOOD' => true,
+ 'USER_DEACTIVATED_BAN' => true,
+ 'INPUT_METHOD_INVALID' => true,
+ 'INPUT_FETCH_ERROR' => true,
+ 'AUTH_KEY_UNREGISTERED' => true,
+ 'SESSION_REVOKED' => true,
+ 'USER_DEACTIVATED' => true,
+ 'RPC_SEND_FAIL' => true,
+ 'RPC_CALL_FAIL' => true,
+ 'RPC_MCGET_FAIL' => true,
+ 'INTERDC_5_CALL_ERROR' => true,
+ 'INTERDC_4_CALL_ERROR' => true,
+ 'INTERDC_3_CALL_ERROR' => true,
+ 'INTERDC_2_CALL_ERROR' => true,
+ 'INTERDC_1_CALL_ERROR' => true,
+ 'INTERDC_5_CALL_RICH_ERROR' => true,
+ 'INTERDC_4_CALL_RICH_ERROR' => true,
+ 'INTERDC_3_CALL_RICH_ERROR' => true,
+ 'INTERDC_2_CALL_RICH_ERROR' => true,
+ 'INTERDC_1_CALL_RICH_ERROR' => true,
+ 'AUTH_KEY_DUPLICATED' => true,
+ 'CONNECTION_NOT_INITED' => true,
+ 'LOCATION_NOT_AVAILABLE' => true,
+ 'AUTH_KEY_INVALID' => true,
+ 'LANG_CODE_EMPTY' => true,
+ 'memory limit exit' => true,
+ 'memory limit(?)' => true,
+ 'INPUT_REQUEST_TOO_LONG' => true,
+ 'SESSION_PASSWORD_NEEDED' => true,
+ 'INPUT_FETCH_FAIL' => true,
+ 'CONNECTION_SYSTEM_EMPTY' => true,
+ 'FILE_WRITE_FAILED' => true,
+ 'STORAGE_CHOOSE_VOLUME_FAILED' => true,
+ 'xxx' => true,
+ 'AES_DECRYPT_FAILED' => true,
+ 'Timedout' => true,
+ 'SEND_REACTION_RESULT1_INVALID' => true,
+ 'TEMPNAM_FAILED' => true,
+ 'MSG_WAIT_TIMEOUT' => true,
+ 'MEMBER_CHAT_ADD_FAILED' => true,
+ 'CHAT_FROM_CALL_CHANGED' => true,
+ 'MTPROTO_CLUSTER_INVALID' => true,
+ 'CONNECTION_DEVICE_MODEL_EMPTY' => true,
+ 'AUTH_KEY_PERM_EMPTY' => true,
+ 'UNKNOWN_METHOD' => true,
+ 'ENCRYPTION_OCCUPY_FAILED' => true,
+ 'ENCRYPTION_OCCUPY_ADMIN_FAILED' => true,
+ 'CHAT_OCCUPY_USERNAME_FAILED' => true,
+ 'REG_ID_GENERATE_FAILED' => true,
+ 'CONNECTION_LANG_PACK_INVALID' => true,
+ 'MSGID_DECREASE_RETRY' => true,
+ 'API_CALL_ERROR' => true,
+ 'STORAGE_CHECK_FAILED' => true,
+ 'INPUT_LAYER_INVALID' => true,
+ 'NEED_MEMBER_INVALID' => true,
+ 'NEED_CHAT_INVALID' => true,
+ 'HISTORY_GET_FAILED' => true,
+ 'CHP_CALL_FAIL' => true,
+ 'IMAGE_ENGINE_DOWN' => true,
+ 'MSG_RANGE_UNSYNC' => true,
+ 'PTS_CHANGE_EMPTY' => true,
+ 'CONNECTION_SYSTEM_LANG_CODE_EMPTY' => true,
+ 'WORKER_BUSY_TOO_LONG_RETRY' => true,
+ 'WP_ID_GENERATE_FAILED' => true,
+ 'ARR_CAS_FAILED' => true,
+ 'CHANNEL_ADD_INVALID' => true,
+ 'CHANNEL_ADMINS_INVALID' => true,
+ 'CHAT_OCCUPY_LOC_FAILED' => true,
+ 'GROUPED_ID_OCCUPY_FAILED' => true,
+ 'GROUPED_ID_OCCUPY_FAULED' => true,
+ 'LOG_WRAP_FAIL' => true,
+ 'MEMBER_FETCH_FAILED' => true,
+ 'MEMBER_OCCUPY_PRIMARY_LOC_FAILED' => true,
+ 'MEMBER_NO_LOCATION' => true,
+ 'MEMBER_OCCUPY_USERNAME_FAILED' => true,
+ 'MT_SEND_QUEUE_TOO_LONG' => true,
+ 'POSTPONED_TIMEOUT' => true,
+ 'RPC_CONNECT_FAILED' => true,
+ 'SHORTNAME_OCCUPY_FAILED' => true,
+ 'STORE_INVALID_OBJECT_TYPE' => true,
+ 'STORE_INVALID_SCALAR_TYPE' => true,
+ 'TMSG_ADD_FAILED' => true,
+ 'UNKNOWN_ERROR' => true,
+ 'UPLOAD_NO_VOLUME' => true,
+ 'USER_NOT_AVAILABLE' => true,
+ 'VOLUME_LOC_NOT_FOUND' => true,
+ 'FILE_WRITE_EMPTY' => true,
+ 'Internal_Server_Error' => true,
+ 'INVITE_HASH_UNSYNC' => true,
+ 'CHANNEL_ID_GENERATE_FAILED' => true,
+ 'Invalid msgs_state_req query' => true,
+ ]]]>
+
@@ -5533,6 +5751,7 @@
+ remoteLayer === 8]]>
@@ -5855,6 +6074,9 @@
+
+
+
@@ -6276,34 +6498,24 @@
-
+
extra['address']]]>
extra['port']]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
- bufferRead(1)]]>
-
extra['address']]]>
extra['password']]]>
extra['port']]]>
extra['username']]]>
+
+
+
+ bufferRead(1)]]>
+
@@ -6317,11 +6529,6 @@
getStream()]]>
-
-
-
-
-
@@ -6334,6 +6541,26 @@
+ extra['password']]]>
+ extra['username']]]>
+
+
+ extra['address']]]>
+ extra['password']]]>
+ extra['port']]]>
+ extra['username']]]>
+
+
+
+
+
+
+ extra['address']]]>
+ extra['password']]]>
+ extra['port']]]>
+ extra['username']]]>
+
+
bufferRead(1)]]>
bufferRead(1)]]>
bufferRead(1)]]>
@@ -6346,98 +6573,27 @@
bufferRead(16)]]>
bufferRead(2)]]>
bufferRead(4)]]>
- extra['password']]]>
- extra['username']]]>
-
-
- extra['address']]]>
- extra['password']]]>
- extra['port']]]>
- extra['username']]]>
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- extra['address']]]>
- extra['password']]]>
- extra['port']]]>
- extra['username']]]>
-
+
getStream(\chr(5).\chr(\strlen($methods)).$methods)]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- stream]]>
-
-
- stream]]>
-
-
- stream]]>
-
-
-
-
-
- stream]]>
-
@@ -6789,6 +6945,11 @@
+
+
+ [0 => 'image/webp'], 'png' => [0 => 'image/png', 1 => 'image/x-png'], 'bmp' => [0 => 'image/bmp', 1 => 'image/x-bmp', 2 => 'image/x-bitmap', 3 => 'image/x-xbitmap', 4 => 'image/x-win-bitmap', 5 => 'image/x-windows-bmp', 6 => 'image/ms-bmp', 7 => 'image/x-ms-bmp', 8 => 'application/bmp', 9 => 'application/x-bmp', 10 => 'application/x-win-bitmap'], 'gif' => [0 => 'image/gif'], 'jpeg' => [0 => 'image/jpeg', 1 => 'image/pjpeg'], 'xspf' => [0 => 'application/xspf+xml'], 'vlc' => [0 => 'application/videolan'], 'wmv' => [0 => 'video/x-ms-wmv', 1 => 'video/x-ms-asf'], 'au' => [0 => 'audio/x-au'], 'ac3' => [0 => 'audio/ac3'], 'flac' => [0 => 'audio/x-flac'], 'ogg' => [0 => 'audio/ogg', 1 => 'video/ogg', 2 => 'application/ogg'], 'kmz' => [0 => 'application/vnd.google-earth.kmz'], 'kml' => [0 => 'application/vnd.google-earth.kml+xml'], 'rtx' => [0 => 'text/richtext'], 'rtf' => [0 => 'text/rtf'], 'jar' => [0 => 'application/java-archive', 1 => 'application/x-java-application', 2 => 'application/x-jar'], 'zip' => [0 => 'application/x-zip', 1 => 'application/zip', 2 => 'application/x-zip-compressed', 3 => 'application/s-compressed', 4 => 'multipart/x-zip'], '7zip' => [0 => 'application/x-compressed'], 'xml' => [0 => 'application/xml', 1 => 'text/xml'], 'svg' => [0 => 'image/svg+xml'], '3g2' => [0 => 'video/3gpp2'], '3gp' => [0 => 'video/3gp', 1 => 'video/3gpp'], 'mp4' => [0 => 'video/mp4'], 'm4a' => [0 => 'audio/x-m4a'], 'f4v' => [0 => 'video/x-f4v'], 'flv' => [0 => 'video/x-flv'], 'webm' => [0 => 'video/webm'], 'aac' => [0 => 'audio/x-acc'], 'm4u' => [0 => 'application/vnd.mpegurl'], 'pdf' => [0 => 'application/pdf', 1 => 'application/octet-stream'], 'pptx' => [0 => 'application/vnd.openxmlformats-officedocument.presentationml.presentation'], 'ppt' => [0 => 'application/powerpoint', 1 => 'application/vnd.ms-powerpoint', 2 => 'application/vnd.ms-office', 3 => 'application/msword'], 'docx' => [0 => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'], 'xlsx' => [0 => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 1 => 'application/vnd.ms-excel'], 'xl' => [0 => 'application/excel'], 'xls' => [0 => 'application/msexcel', 1 => 'application/x-msexcel', 2 => 'application/x-ms-excel', 3 => 'application/x-excel', 4 => 'application/x-dos_ms_excel', 5 => 'application/xls', 6 => 'application/x-xls'], 'xsl' => [0 => 'text/xsl'], 'mpeg' => [0 => 'video/mpeg'], 'mov' => [0 => 'video/quicktime'], 'avi' => [0 => 'video/x-msvideo', 1 => 'video/msvideo', 2 => 'video/avi', 3 => 'application/x-troff-msvideo'], 'movie' => [0 => 'video/x-sgi-movie'], 'log' => [0 => 'text/x-log'], 'txt' => [0 => 'text/plain'], 'css' => [0 => 'text/css'], 'html' => [0 => 'text/html'], 'wav' => [0 => 'audio/x-wav', 1 => 'audio/wave', 2 => 'audio/wav'], 'xhtml' => [0 => 'application/xhtml+xml'], 'tar' => [0 => 'application/x-tar'], 'tgz' => [0 => 'application/x-gzip-compressed'], 'psd' => [0 => 'application/x-photoshop', 1 => 'image/vnd.adobe.photoshop'], 'exe' => [0 => 'application/x-msdownload'], 'js' => [0 => 'application/x-javascript'], 'mp3' => [0 => 'audio/mpeg', 1 => 'audio/mpg', 2 => 'audio/mpeg3', 3 => 'audio/mp3'], 'rar' => [0 => 'application/x-rar', 1 => 'application/rar', 2 => 'application/x-rar-compressed'], 'gzip' => [0 => 'application/x-gzip'], 'hqx' => [0 => 'application/mac-binhex40', 1 => 'application/mac-binhex', 2 => 'application/x-binhex40', 3 => 'application/x-mac-binhex40'], 'cpt' => [0 => 'application/mac-compactpro'], 'bin' => [0 => 'application/macbinary', 1 => 'application/mac-binary', 2 => 'application/x-binary', 3 => 'application/x-macbinary'], 'oda' => [0 => 'application/oda'], 'ai' => [0 => 'application/postscript'], 'smil' => [0 => 'application/smil'], 'mif' => [0 => 'application/vnd.mif'], 'wbxml' => [0 => 'application/wbxml'], 'wmlc' => [0 => 'application/wmlc'], 'dcr' => [0 => 'application/x-director'], 'dvi' => [0 => 'application/x-dvi'], 'gtar' => [0 => 'application/x-gtar'], 'php' => [0 => 'application/x-httpd-php', 1 => 'application/php', 2 => 'application/x-php', 3 => 'text/php', 4 => 'text/x-php', 5 => 'application/x-httpd-php-source'], 'swf' => [0 => 'application/x-shockwave-flash'], 'sit' => [0 => 'application/x-stuffit'], 'z' => [0 => 'application/x-compress'], 'mid' => [0 => 'audio/midi'], 'aif' => [0 => 'audio/x-aiff', 1 => 'audio/aiff'], 'ram' => [0 => 'audio/x-pn-realaudio'], 'rpm' => [0 => 'audio/x-pn-realaudio-plugin'], 'ra' => [0 => 'audio/x-realaudio'], 'rv' => [0 => 'video/vnd.rn-realvideo'], 'jp2' => [0 => 'image/jp2', 1 => 'video/mj2', 2 => 'image/jpx', 3 => 'image/jpm'], 'tiff' => [0 => 'image/tiff'], 'eml' => [0 => 'message/rfc822'], 'pem' => [0 => 'application/x-x509-user-cert', 1 => 'application/x-pem-file'], 'p10' => [0 => 'application/x-pkcs10', 1 => 'application/pkcs10'], 'p12' => [0 => 'application/x-pkcs12'], 'p7a' => [0 => 'application/x-pkcs7-signature'], 'p7c' => [0 => 'application/pkcs7-mime', 1 => 'application/x-pkcs7-mime'], 'p7r' => [0 => 'application/x-pkcs7-certreqresp'], 'p7s' => [0 => 'application/pkcs7-signature'], 'crt' => [0 => 'application/x-x509-ca-cert', 1 => 'application/pkix-cert'], 'crl' => [0 => 'application/pkix-crl', 1 => 'application/pkcs-crl'], 'pgp' => [0 => 'application/pgp'], 'gpg' => [0 => 'application/gpg-keys'], 'rsa' => [0 => 'application/x-pkcs7'], 'ics' => [0 => 'text/calendar'], 'zsh' => [0 => 'text/x-scriptzsh'], 'cdr' => [0 => 'application/cdr', 1 => 'application/coreldraw', 2 => 'application/x-cdr', 3 => 'application/x-coreldraw', 4 => 'image/cdr', 5 => 'image/x-cdr', 6 => 'zz-application/zz-winassoc-cdr'], 'wma' => [0 => 'audio/x-ms-wma'], 'vcf' => [0 => 'text/x-vcard'], 'srt' => [0 => 'text/srt'], 'vtt' => [0 => 'text/vtt'], 'ico' => [0 => 'image/x-icon', 1 => 'image/x-ico', 2 => 'image/vnd.microsoft.icon'], 'csv' => [0 => 'text/x-comma-separated-values', 1 => 'text/comma-separated-values', 2 => 'application/vnd.msexcel'], 'json' => [0 => 'application/json', 1 => 'text/json']]]]>
+
+
@@ -7428,6 +7589,79 @@
+
+
+ 'https://github.com/amphp/mysql',
+ 'mysqli' => 'https://github.com/amphp/mysql',
+ ]]]>
+ 'https://github.com/amphp/file, https://github.com/amphp/http-client or $this->fileGetContents()',
+ 'file_put_contents' => 'https://github.com/amphp/file',
+ 'curl_exec' => 'https://github.com/amphp/http-client',
+ 'mysqli_query' => 'https://github.com/amphp/mysql',
+ 'mysqli_connect' => 'https://github.com/amphp/mysql',
+ 'mysql_connect' => 'https://github.com/amphp/mysql',
+ 'fopen' => 'https://github.com/amphp/file',
+ 'fsockopen' => 'https://github.com/amphp/socket',
+ 'pcntl_fork' => 'Tools::callFork',
+ 'sleep' => '$this->sleep()',
+ 'usleep' => '$this->sleep()',
+ 'proc_open' => 'https://github.com/amphp/process',
+ 'shell_exec' => 'https://github.com/amphp/process',
+ 'exec' => 'https://github.com/amphp/process',
+ ]]]>
+ 'Amp\\File\\read',
+ 'amp\\file\\put' => 'Amp\\File\\write',
+ ]]]>
+
+
+
+
@@ -7461,9 +7695,6 @@
-
-
-
$this->{$var},
diff --git a/schemas b/schemas
index f0d60e35a..1407d279c 160000
--- a/schemas
+++ b/schemas
@@ -1 +1 @@
-Subproject commit f0d60e35a9566ade2a29cd3e9e7f67f323e9ad4d
+Subproject commit 1407d279c0bf6ae94b816ee61b8276713079bd66
diff --git a/src/API.php b/src/API.php
index c7cd87192..0b3d2818e 100644
--- a/src/API.php
+++ b/src/API.php
@@ -51,7 +51,7 @@ final class API extends AbstractAPI
*
* @var string
*/
- public const RELEASE = '8.3.5';
+ public const RELEASE = '8.3.7';
/**
* We're not logged in.
*
diff --git a/src/EventHandler/CallbackQuery.php b/src/EventHandler/CallbackQuery.php
index 392e7ad67..852513813 100644
--- a/src/EventHandler/CallbackQuery.php
+++ b/src/EventHandler/CallbackQuery.php
@@ -40,13 +40,13 @@ abstract class CallbackQuery extends Update
}
/**
- * @param string $message Popup to show
+ * @param ?string $message Popup to show
* @param bool $alert Whether to show the message as a popup instead of a toast notification
* @param string|null $url URL to open
* @param int $cacheTime Cache validity (default set to 5 min based on telegram official docs ...)
*/
public function answer(
- string $message,
+ ?string $message = null,
bool $alert = false,
?string $url = null,
int $cacheTime = 5 * 60
diff --git a/src/EventHandler/Message/Entities/TextWithEntities.php b/src/EventHandler/Message/Entities/TextWithEntities.php
new file mode 100644
index 000000000..5eaa03ea0
--- /dev/null
+++ b/src/EventHandler/Message/Entities/TextWithEntities.php
@@ -0,0 +1,71 @@
+.
+ *
+ * @author Mahdi
+ * @copyright 2016-2023 Mahdi
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3
+ * @link https://docs.madelineproto.xyz MadelineProto documentation
+ */
+
+namespace danog\MadelineProto\EventHandler\Message\Entities;
+
+use danog\MadelineProto\ParseMode;
+use danog\MadelineProto\StrTools;
+use JsonSerializable;
+use ReflectionClass;
+use ReflectionProperty;
+
+final class TextWithEntities implements JsonSerializable
+{
+ public function __construct(
+ /** Text */
+ public readonly string $text,
+ /**
+ * Message entities for styled text.
+ * @var list
+ */
+ public readonly array $entities,
+ /** Whether to parse HTML or Markdown markup in the message */
+ public readonly ?ParseMode $parseMode,
+ ) {
+ }
+
+ /** @internal */
+ public function jsonSerialize(): mixed
+ {
+ $res = ['_' => static::class];
+ $refl = new ReflectionClass($this);
+ foreach ($refl->getProperties(ReflectionProperty::IS_PUBLIC) as $prop) {
+ $res[$prop->getName()] = $prop->getValue($this);
+ }
+ return $res;
+ }
+
+ protected readonly string $html;
+ protected readonly string $htmlTelegram;
+
+ /**
+ * Get an HTML version of the message.
+ *
+ * @psalm-suppress InaccessibleProperty
+ *
+ * @param bool $allowTelegramTags Whether to allow telegram-specific tags like tg-spoiler, tg-emoji, mention links and so on...
+ */
+ public function getHTML(bool $allowTelegramTags = false): string
+ {
+ if (!$this->entities) {
+ return StrTools::htmlEscape($this->text);
+ }
+ if ($allowTelegramTags) {
+ return $this->htmlTelegram ??= StrTools::entitiesToHtml($this->text, MessageEntity::fromRawEntities($this->entities), $allowTelegramTags);
+ }
+ return $this->html ??= StrTools::entitiesToHtml($this->text, MessageEntity::fromRawEntities($this->entities), $allowTelegramTags);
+ }
+}
diff --git a/src/EventHandler/Message/Service/DialogGiftStars.php b/src/EventHandler/Message/Service/DialogGiftStars.php
new file mode 100644
index 000000000..fae9bcc45
--- /dev/null
+++ b/src/EventHandler/Message/Service/DialogGiftStars.php
@@ -0,0 +1,47 @@
+.
+ *
+ * @author Mahdi
+ * @copyright 2016-2023 Mahdi
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3
+ * @link https://docs.madelineproto.xyz MadelineProto documentation
+ */
+
+namespace danog\MadelineProto\EventHandler\Message\Service;
+
+use danog\MadelineProto\EventHandler\Message\ServiceMessage;
+use danog\MadelineProto\MTProto;
+
+/**
+ * Info about a gifted Telegram Stars.
+ */
+class DialogGiftStars extends ServiceMessage
+{
+ /** @internal */
+ public function __construct(
+ MTProto $API,
+ array $rawMessage,
+ array $info,
+ /** Three-letter ISO 4217 currency code */
+ public readonly string $currency,
+ /** Price of the gift in the smallest units of the currency (integer, not float/double). */
+ public readonly int $amount,
+ /** Amount of gifted stars */
+ public readonly int $stars,
+ /** If the gift was bought using a cryptocurrency, the cryptocurrency name. */
+ public readonly ?string $cryptoCurrency,
+ /** If the gift was bought using a cryptocurrency, price of the gift in the smallest units of a cryptocurrency. */
+ public readonly ?int $cryptoAmount,
+ /** Identifier of the transaction, only visible to the receiver of the gift. */
+ public readonly string $transactionId,
+ ) {
+ parent::__construct($API, $rawMessage, $info);
+ }
+}
diff --git a/src/EventHandler/Message/Service/DialogStarGift.php b/src/EventHandler/Message/Service/DialogStarGift.php
new file mode 100644
index 000000000..42f08947a
--- /dev/null
+++ b/src/EventHandler/Message/Service/DialogStarGift.php
@@ -0,0 +1,49 @@
+.
+ *
+ * @author Mahdi
+ * @copyright 2016-2023 Mahdi
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3
+ * @link https://docs.madelineproto.xyz MadelineProto documentation
+ */
+
+namespace danog\MadelineProto\EventHandler\Message\Service;
+
+use danog\MadelineProto\EventHandler\Message\Entities\TextWithEntities;
+use danog\MadelineProto\EventHandler\Message\ServiceMessage;
+use danog\MadelineProto\EventHandler\Payments\StarGift;
+use danog\MadelineProto\MTProto;
+
+/**
+ * Info about a Star gifted.
+ */
+class DialogStarGift extends ServiceMessage
+{
+ /** @internal */
+ public function __construct(
+ MTProto $API,
+ array $rawMessage,
+ array $info,
+ /** Show the name of sender hide or no */
+ public readonly ?bool $hide,
+ /** Show the gift is saved on profile or no */
+ public readonly ?bool $saved,
+ /** Show the gift is converted to stars or no */
+ public readonly ?bool $converted,
+ /** The gift */
+ public readonly StarGift $gift,
+ /** Styled text that sender of gift provided */
+ public readonly ?TextWithEntities $message,
+ /** Amount of stars after the gift converted */
+ public readonly ?int $convertStars
+ ) {
+ parent::__construct($API, $rawMessage, $info);
+ }
+}
diff --git a/src/EventHandler/Payments/Payment.php b/src/EventHandler/Payments/Payment.php
new file mode 100644
index 000000000..fa06be852
--- /dev/null
+++ b/src/EventHandler/Payments/Payment.php
@@ -0,0 +1,90 @@
+.
+ *
+ * @author Mahdi
+ * @copyright 2016-2023 Mahdi
+ * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3
+ * @link https://docs.madelineproto.xyz MadelineProto documentation
+ */
+
+namespace danog\MadelineProto\EventHandler\Payments;
+
+use danog\MadelineProto\EventHandler\Update;
+use danog\MadelineProto\MTProto;
+
+/**
+ * This object contains information about an incoming pre-checkout query.
+ */
+class Payment extends Update
+{
+ /** Unique query identifier */
+ public readonly int $queryId;
+ /** User who sent the query */
+ public readonly int $userId;
+ /** Bot specified invoice payload */
+ public readonly string $payload;
+ /** Order info provided by the user */
+ public readonly ?PaymentRequestedInfo $info;
+ /** Identifier of the shipping option chosen by the user */
+ public readonly ?string $shippingOptionId;
+ /** Three-letter ISO 4217 currency code */
+ public readonly string $currency;
+ /**Total amount in the smallest units of the currency (integer, not float/double). */
+ public readonly int $totalAmount;
+ /** @internal */
+ public function __construct(MTProto $API, array $rawRequestedPayment)
+ {
+ parent::__construct($API);
+ $this->queryId = $rawRequestedPayment['query_id'];
+ $this->userId = $rawRequestedPayment['user_id'];
+ $this->payload = $rawRequestedPayment['payload'];
+ $this->info = isset($rawRequestedPayment['payload']) ? new PaymentRequestedInfo(
+ $rawRequestedPayment['name'],
+ $rawRequestedPayment['phone'],
+ $rawRequestedPayment['email'],
+ ) : null;
+ $this->shippingOptionId = $rawRequestedPayment['shipping_option_id'] ?? null;
+ $this->currency = $rawRequestedPayment['currency'];
+ $this->totalAmount = $rawRequestedPayment['total_amount'];
+
+ }
+
+ /**
+ * Accept pending payment.
+ * note that you must call this function or reject function up to 10 seconds after user accept payment!!.
+ */
+ public function accept(): true
+ {
+ return $this->getClient()->methodCallAsyncRead(
+ 'messages.setBotPrecheckoutResults',
+ [
+ 'success' => true,
+ 'query_id' => $this->queryId,
+ ]
+ );
+ }
+
+ /**
+ * Reject pending payment.
+ * note that you must call this function or accept function up to 10 seconds after user accept payment!!.
+ * @param string $errorMessage if the success isn’t set. Error message in human-readable form that explains the reason for failure to proceed with the checkout
+ */
+ public function reject(string $errorMessage): false
+ {
+ return $this->getClient()->methodCallAsyncRead(
+ 'messages.setBotPrecheckoutResults',
+ [
+ 'success' => false,
+ 'query_id' => $this->queryId,
+ 'error' => $errorMessage,
+ ]
+ );
+ }
+}
diff --git a/src/EventHandler/Payments/PaymentRequestedInfo.php b/src/EventHandler/Payments/PaymentRequestedInfo.php
new file mode 100644
index 000000000..cfc48380e
--- /dev/null
+++ b/src/EventHandler/Payments/PaymentRequestedInfo.php
@@ -0,0 +1,32 @@
+ static::class];
+ $refl = new ReflectionClass($this);
+ foreach ($refl->getProperties(ReflectionProperty::IS_PUBLIC) as $prop) {
+ $res[$prop->getName()] = $prop->getValue($this);
+ }
+ return $res;
+ }
+}
diff --git a/src/EventHandler/Payments/StarGift.php b/src/EventHandler/Payments/StarGift.php
new file mode 100644
index 000000000..b00ce25db
--- /dev/null
+++ b/src/EventHandler/Payments/StarGift.php
@@ -0,0 +1,61 @@
+limited = $rawStarGift['limited'] ?? null;
+ $this->soldOut = $rawStarGift['sold_out'] ?? null;
+ $this->id = $rawStarGift['id'];
+ $this->sticker = isset($rawStarGift['sticker']) ?
+ new StaticSticker(
+ $API,
+ $rawStarGift['sticker'],
+ $rawStarGift['sticker']['attributes'],
+ $rawStarGift['sticker']['attributes'],
+ false
+ ) : null;
+ $this->stars = $rawStarGift['stars'];
+ $this->availabilityRemains = $rawStarGift['availability_remains'] ?? null;
+ $this->availabilityTotal = $rawStarGift['availability_total'] ?? null;
+ $this->convertStars = $rawStarGift['convert_stars'];
+ $this->startSell = $rawStarGift['first_sale_date'] ?? null;
+ $this->endSell = $rawStarGift['last_sale_date'] ?? null;
+ parent::__construct($API);
+ }
+
+ /** @internal */
+ public function jsonSerialize(): mixed
+ {
+ $v = get_object_vars($this);
+ unset($v['API'], $v['session']);
+ return $v;
+ }
+}
diff --git a/src/Lang.php b/src/Lang.php
index c2336e884..439c4a98a 100644
--- a/src/Lang.php
+++ b/src/Lang.php
@@ -30,7 +30,7 @@ final class Lang
'ckb' => 74,
'fa' => 100,
'pt' => 0,
- 'ru' => 58,
+ 'ru' => 82,
'uz' => 75,
];
@@ -1383,8 +1383,8 @@ If you intentionally deleted this account, ignore this message.',
],
'ru' =>
[
- '2fa_uncalled' => 'I\'m not waiting for the password! Please call the phoneLogin and the completePhoneLogin methods first!',
- 'accepting_call' => 'Accepting call from %s...',
+ '2fa_uncalled' => 'Я не жду сейчас пароля! Вызовите сначала методы phoneLogin и completePhoneLogin!',
+ 'accepting_call' => 'Принимяю звонок от %s...',
'account_banned' => '!!!!!!! WARNING !!!!!!!
Telegram\'s flood prevention system suspended this account.
To continue, manual verification is required.
@@ -1419,23 +1419,23 @@ If you intentionally deleted this account, ignore this message.',
'apiManualWeb' => 'Введите ваш API ID и API hash',
'apiParamsError' => 'Вы не заполнили все обязательные параметры!',
'api_not_set' => 'Необходимо указать свой api ключ, достаньте свой @ my.telegram.org',
- 'array_invalid' => 'You didn\'t provide a valid array',
+ 'array_invalid' => 'Вы указали невалидный массив',
'baseDirLimitation' => 'Настройка basedir сконфигурирована: это может повлиять на производительность и вызвать некоторые проблемы, отключите её если это возможно!',
- 'bool_error' => 'Could not extract boolean',
+ 'bool_error' => 'Невозможно считать boolean',
'botAlreadyRunning' => 'Бот уже запущен!',
'botapi_conversion_error' => 'Can\'t convert %s to a bot API object',
- 'call_already_accepted' => 'Call %s already accepted',
- 'call_already_declined' => 'Call %s already declined',
- 'call_completing' => 'Completing call from %s...',
- 'call_confirming' => 'Confirming call from %s...',
- 'call_discarding' => 'Discarding call %s...',
- 'call_error_1' => 'Could not find and accept call %s',
- 'call_error_2' => 'Could not find and confirm call %s',
- 'call_error_3' => 'Could not find and complete call %s',
+ 'call_already_accepted' => 'Звонок %s уже был принят',
+ 'call_already_declined' => 'Звонок %s уже был отвергнут',
+ 'call_completing' => 'Финализирую звонок от %s...',
+ 'call_confirming' => 'Подтверждаю звонок от %s...',
+ 'call_discarding' => 'Отвергаю звонок %s...',
+ 'call_error_1' => 'Не смог найти и принять звонок %s',
+ 'call_error_2' => 'Невозможно найти и подтвердить звонок %s',
+ 'call_error_3' => 'Невозможно найти и подтвердить звонок %s',
'cli_need_dl.php_link' => 'Please specify a download script URL when using getDownloadLink via CLI!',
'constructor_not_found' => 'Constructor not found for type: ',
'could_not_connect_to_MadelineProto' => 'Could not connect to MadelineProto, please enable proc_open and remove open_basedir restrictions or disable webserver path rewrites to fix! If you already did that, make sure the CLI version of PHP is exactly the same as the web version (same version, extensions, et cetera) and check out the MadelineProto.log file for more info about the error that prevented the IPC server from starting.',
- 'could_not_convert_object' => 'Could not convert object of type %s',
+ 'could_not_convert_object' => 'Невозможно сконвертировать объект типа %s',
'deserialization_error' => 'Произошла ошибка при deserialization',
'dl.php_check_logs_make_sure_session_running' => 'Either the associated MadelineProto EventHandler bot or the MadelineProto IPC server are offline, please check logs and make sure at least one of them is running!',
'dl.php_powered_by_madelineproto' => 'Telegram file download server (up to 4GB), powered by MadelineProto!
Click here for more info on how to setup your very own Telegram file download server!',
@@ -1453,12 +1453,12 @@ If you intentionally deleted this account, ignore this message.',
'extensionRequiredInstallWithApt' => 'Попробуйте запустить sudo apt-get install %s.',
'extensionRequiredInstallWithCustomInstructions' => 'Следуйте инструкциям в %s для установки.',
'file_not_exist' => 'Файл не существует',
- 'file_parsing' => 'Parsing %s...',
+ 'file_parsing' => 'Чтение %s...',
'file_type_invalid' => 'Invalid file type detected (%s)',
- 'fingerprint_invalid' => 'Invalid key fingerprint!',
+ 'fingerprint_invalid' => 'Невалидный фингерпринт ключа!',
'go' => 'ОК',
'invalid_dl.php_session' => '%s is not a valid download script because its session ID is different (expected %s, got %s)',
- 'length_too_big' => 'Length is too big',
+ 'length_too_big' => 'Длина слишком большая',
'loginBot' => 'Введите токен бота: ',
'loginBotTokenWeb' => 'Токен бота',
'loginChoosePromptWeb' => 'Авторизоваться как пользователь или как бот?',
@@ -1484,20 +1484,20 @@ If you intentionally deleted this account, ignore this message.',
'loginWebQr3' => 'Наведите ваш смартфон на этот экран чтобы подтвердить вход',
'login_2fa_enabled' => '2FA активно, вам необходимо сначала вызвать функцию complete2falogin...',
'login_auth_key' => 'Вход с помощью ключа авторизации...',
- 'login_bot' => 'Logging in as a bot...',
+ 'login_bot' => 'Вхожу как бот...',
'login_code_sending' => 'Отправка кода...',
'login_code_sent' => 'Код успешно отправлен! Как только Вы получите код Вам нужно использовать функцию completePhoneLogin.',
'login_code_uncalled' => 'Я не ожидаю код! Пожалуйста сначала вызовите метод phoneLogin',
- 'login_need_signup' => 'An account has not been created for this number, you will have to call the completeSignup function...',
+ 'login_need_signup' => 'На этот номер телефона не найдена учётная запись Телеграм...',
'login_ok' => 'Мы залогинены!',
- 'login_user' => 'Logging in as a normal user...',
+ 'login_user' => 'Вхожу как пользователь...',
'logout_ok' => 'Logout!',
- 'long_not_16' => 'Given value is not 16 bytes long',
- 'long_not_32' => 'Given value is not 32 bytes long',
- 'long_not_64' => 'Given value is not 64 bytes long',
+ 'long_not_16' => 'Длинна данного значения не равна 16 байтам',
+ 'long_not_32' => 'Длинна данного значения не равна 32 байтам',
+ 'long_not_64' => 'Длинна данного значения не равна 64 байтам',
'madelineproto_ready' => 'MadelineProto готов!',
'manualAdminActionRequired' => '!!!!!!!!! НЕОБХОДИМЫ РУЧНЫЕ ДЕЙСТВИЯ СИСТЕМНОГО АДМИНИСТРАТОРА !!!!!!!!!',
- 'method_not_found' => 'Could not find method: ',
+ 'method_not_found' => 'Невозможно найти метод: ',
'mmapErrorPart1' => 'Превышено максимальное количество маппированных зон памяти (%s, это НЕ потребление памяти, а mmap): пожалуйста увеличьте значение настройки ядра vm.max_map_count до 262144, чтобы исправить проблему.',
'mmapErrorPart2' => 'Чтобы исправить, необходимо запустить эту команду как root: %s',
'mmapErrorPart3' => 'Чтобы сохранить настройки даже после перезапуска: %s',
@@ -1508,16 +1508,16 @@ If you intentionally deleted this account, ignore this message.',
'noReportPeers' => 'Внимание: не настроен ни один юзер для сообщения ошибок, пожалуйста добавьте этот метод в Event Handler',
'non_text_conversion' => 'Can\'t convert non text messages yet!',
'not_loggedIn' => 'Я вошёл в систему!',
- 'not_numeric' => 'Given value isn\'t numeric',
- 'params_missing' => 'Missing required parameter',
- 'peer_not_in_db' => 'This peer is not present in the internal peer database',
+ 'not_numeric' => 'Данное значение не цифра',
+ 'params_missing' => 'Не хватает необходимого папаметра',
+ 'peer_not_in_db' => 'Этот peer не находится во внутренней базе',
'plugin_path_does_not_exist' => 'Plugin path %s does not exist!',
'plugins_do_not_use_require' => 'for performance reasons, plugins can only automatically include or require other files present in the plugins folder by triggering the PSR-4 autoloader (not by manually require()\'ing them).',
'plugins_must_have_exactly_one_class' => 'a plugin must define exactly one class! To define multiple classes, interfaces or traits, create separate files, they will be autoloaded by MadelineProto automatically.',
- 'predicate_not_set' => 'Predicate (value under _) was not set!',
+ 'predicate_not_set' => 'Предикат (значение под ключом _) не был указан!',
'recommend_not_use_filesystem_function' => 'usage of the %s function is not recommended, because accessing the filesystem during update handling will slow down your bot, please see https://docs.madelineproto.xyz/docs/UPDATES.html#avoiding-the-use-of-filesystem-functions for a list of alternative ways to store data that will not slow down your bot!',
'rpc_tg_error' => 'Телеграм возвратил RPC ошибку: %s (%s), из-за %s:%s%sTL trace:',
- 'sec_peer_not_in_db' => 'This secret peer is not present in the internal peer database',
+ 'sec_peer_not_in_db' => 'Этого секретного чата нету во внутренней базе',
'secret_chat_skipping' => 'I do not have the secret chat %s in the database, skipping message...',
'serialization_ofd' => 'Сериализация старая, реконструкция объекта!',
'session_corrupted' => 'Сессия повреждена!',
@@ -1527,26 +1527,26 @@ If you intentionally deleted this account, ignore this message.',
'signupLastName' => 'Введите вашу фамилию (может быть пустым): ',
'signupLastNameWeb' => 'Фамилия',
'signupWeb' => 'Зарегистрируйтесь, пожалуйста',
- 'signup_ok' => 'Signed up in successfully!',
- 'signup_uncalled' => 'I\'m not waiting to signup! Please call the phoneLogin and the completePhoneLogin methods first!',
- 'src_file_invalid' => 'Invalid source file was provided: ',
+ 'signup_ok' => 'Запись прошла успешно!',
+ 'signup_uncalled' => 'Я не в процессе записи! Пожалуйста, вызовите сначала методы phoneLogin и completePhoneLogin!',
+ 'src_file_invalid' => 'Невалидный файл: ',
'static_analysis_minor' => 'A minor issue was encountered during static analysis of %s: %s',
'static_analysis_severe' => 'A severe issue was encountered during static analysis of %s: %s',
- 'stream_handle_invalid' => 'An invalid stream handle was provided.',
- 'string_required' => 'A string was expected!',
- 'translate_madelineproto_cli' => 'MadelineProto can be translated in your language (current translation progress: %d%%), go to https://weblate.madelineproto.xyz to contribute with the translation!',
- 'translate_madelineproto_web' => 'MadelineProto can be translated in your language (current translation progress: %d%%), click here to contribute with the translation!',
- 'type_extract_error' => 'Could not extract type "%s", you should update MadelineProto!',
+ 'stream_handle_invalid' => 'Использован невалидный стрим.',
+ 'string_required' => 'Ожидана string!',
+ 'translate_madelineproto_cli' => 'MadelineProto можно локализировать на ваш язык (на данный момент переведено: %d%%), откройте https://weblate.madelineproto.xyz чтобы помочь с переводом!',
+ 'translate_madelineproto_web' => 'MadelineProto можно локализировать на ваш язык (на данный момент переведено: %d%%), кликните сюда чтобы помочь с переводом!',
+ 'type_extract_error' => 'Невозможно распаковать тип "%s", необходимо обновить MadelineProto!',
'type_extract_error_id' => 'Could not extract type: %s with id %s, you should update MadelineProto!',
- 'update_madelineproto' => 'You\'re running an old version of MadelineProto, an update is required: currently running %s, but the latest version with multiple bugfixes and new features is %s!',
+ 'update_madelineproto' => 'Вы используете старую версию MadelineProto, необходимо обновится: сейчас используется версия %s, но последняя версия со многими поправками и с новым функционалом - %s!',
'value_bigger_than_2147483647' => 'Значение %s больше чем 2147483647',
'value_bigger_than_4294967296' => 'Значение %s больше чем 4294967296',
'value_bigger_than_9223372036854775807' => 'Значение %s больше чем 9223372036854775807',
'value_smaller_than_0' => 'Значение %s меньше нуля',
'value_smaller_than_2147483648' => 'Значение %s меньше чем -2147483648',
'value_smaller_than_9223372036854775808' => 'Значение %s меньше чем -9223372036854775808',
- 'waveform_must_have_100_values' => 'A waveform array must have 100 values!',
- 'waveform_value' => 'A waveform value must be between 0 and 31!',
+ 'waveform_must_have_100_values' => 'Массив waveform должен иметь 100 значений!',
+ 'waveform_value' => 'Значение waveform должно быть между 0 и 31!',
'windows_warning' => 'For Windows users: please switch to Linux if this fails. You can also try modifying the firewall settings to allow all PHP processes to create sockets (it\'s 100% easier to just switch to Linux, on Linux MadelineProto just works out of the box, no changes needed)',
],
'uz' =>
diff --git a/src/MTProtoSession/ResponseHandler.php b/src/MTProtoSession/ResponseHandler.php
index c651c4510..0aec1b0cc 100644
--- a/src/MTProtoSession/ResponseHandler.php
+++ b/src/MTProtoSession/ResponseHandler.php
@@ -411,6 +411,7 @@ trait ResponseHandler
return static fn () => RPCErrorException::make($response['error_message'], $response['error_code'], $request->constructor);
case 420:
$seconds = (int) preg_replace('/[^0-9]+/', '', $response['error_message']);
+ \assert($seconds > 0);
$limit = $request->floodWaitLimit ?? $this->API->settings->getRPC()->getFloodTimeout();
if ($seconds < $limit) {
$this->API->logger("Flood, waiting $seconds seconds before repeating async call of $request...", Logger::NOTICE);
diff --git a/src/MTProtoTools/Files.php b/src/MTProtoTools/Files.php
index 9d8603a3c..d6af55814 100644
--- a/src/MTProtoTools/Files.php
+++ b/src/MTProtoTools/Files.php
@@ -320,22 +320,26 @@ trait Files
};
$resPromises = [];
$start = microtime(true);
+ /** @var ?FloodPremiumWaitError */
+ $floodWaitError = null;
while ($part_num < $part_total_num || !$size) {
if ($seekable) {
- $writeCb = function () use ($method, $callable, $part_num, $cancellation, &$datacenter): WrappedFuture {
+ $writeCb = function () use ($method, $callable, $part_num, $cancellation, &$datacenter, &$floodWaitError): WrappedFuture {
+ $floodWaitError?->wait($cancellation);
return $this->methodCallAsyncWrite(
$method,
- $callable($part_num) + ['cancellation' => $cancellation],
+ $callable($part_num) + ['cancellation' => $cancellation, 'floodWaitLimit' => 0],
$datacenter
);
};
} else {
try {
- $part = $callable($part_num) + ['cancellation' => $cancellation];
+ $part = $callable($part_num) + ['cancellation' => $cancellation, 'floodWaitLimit' => 0];
} catch (StreamEof) {
break;
}
- $writeCb = function () use ($method, $part, &$datacenter): WrappedFuture {
+ $writeCb = function () use ($method, $part, &$datacenter, &$floodWaitError, $cancellation): WrappedFuture {
+ $floodWaitError?->wait($cancellation);
return $this->methodCallAsyncWrite(
$method,
$part,
@@ -344,11 +348,11 @@ trait Files
};
}
$writePromise = async($writeCb);
- EventLoop::queue(function () use ($writePromise, $cb, $part_num, $size, &$resPromises, $cancellation, $writeCb, &$datacenter): void {
+ EventLoop::queue(function () use ($writePromise, $cb, $part_num, $size, &$resPromises, $cancellation, $writeCb, &$datacenter, &$floodWaitError): void {
+ $d = new DeferredFuture;
+ $resPromises[] = $d->getFuture();
do {
$readFuture = $writePromise->await($cancellation);
- $d = new DeferredFuture;
- $resPromises[] = $d->getFuture();
try {
// Wrote chunk!
if (!$readFuture->await($cancellation)) {
@@ -361,19 +365,16 @@ trait Files
$d->complete();
return;
} catch (FloodPremiumWaitError $e) {
- $this->logger("Got {$e->rpc} while uploading $part_num: {$datacenter}, retrying...");
- $writePromise = async(static function () use ($cancellation, $e, $writeCb): void {
- $e->wait($cancellation);
- $writeCb();
- });
+ $this->logger("Got {$e->rpc} while uploading part $part_num: {$datacenter}, waiting and retrying...");
+ $floodWaitError = $e;
+ $writePromise = async($writeCb);
} catch (FileRedirect $e) {
$datacenter = $e->dc;
- $this->logger("Got redirect while uploading $part_num: {$datacenter}");
+ $this->logger("Got redirect while uploading part $part_num: {$datacenter}");
$writePromise = async($writeCb);
} catch (Throwable $e) {
$cancellation?->throwIfRequested();
- $this->logger("Got exception while uploading $part_num: {$e}");
- $d->error($e);
+ $this->logger("Got exception while uploading part $part_num: {$e}");
$writePromise = async($writeCb);
}
} while (true);
@@ -393,6 +394,9 @@ trait Files
}
await($promises, $cancellation);
await($resPromises, $cancellation);
+ if ($totalSize === 0) {
+ throw new AssertionError('You uploaded an empty file!');
+ }
$time = microtime(true) - $start;
$speed = (int) ($totalSize * 8 / $time) / 1000000;
if (!$size) {
diff --git a/src/MTProtoTools/UpdateHandler.php b/src/MTProtoTools/UpdateHandler.php
index de8141202..7d4e2c273 100644
--- a/src/MTProtoTools/UpdateHandler.php
+++ b/src/MTProtoTools/UpdateHandler.php
@@ -50,6 +50,8 @@ use danog\MadelineProto\EventHandler\InlineQuery;
use danog\MadelineProto\EventHandler\Message;
use danog\MadelineProto\EventHandler\Message\ChannelMessage;
use danog\MadelineProto\EventHandler\Message\CommentReply;
+use danog\MadelineProto\EventHandler\Message\Entities\MessageEntity;
+use danog\MadelineProto\EventHandler\Message\Entities\TextWithEntities;
use danog\MadelineProto\EventHandler\Message\GroupMessage;
use danog\MadelineProto\EventHandler\Message\PrivateMessage;
use danog\MadelineProto\EventHandler\Message\SecretMessage;
@@ -80,11 +82,14 @@ use danog\MadelineProto\EventHandler\Message\Service\DialogScreenshotTaken;
use danog\MadelineProto\EventHandler\Message\Service\DialogSetChatTheme;
use danog\MadelineProto\EventHandler\Message\Service\DialogSetChatWallPaper;
use danog\MadelineProto\EventHandler\Message\Service\DialogSetTTL;
+use danog\MadelineProto\EventHandler\Message\Service\DialogStarGift;
use danog\MadelineProto\EventHandler\Message\Service\DialogSuggestProfilePhoto;
use danog\MadelineProto\EventHandler\Message\Service\DialogTitleChanged;
use danog\MadelineProto\EventHandler\Message\Service\DialogTopicCreated;
use danog\MadelineProto\EventHandler\Message\Service\DialogTopicEdited;
use danog\MadelineProto\EventHandler\Message\Service\DialogWebView;
+use danog\MadelineProto\EventHandler\Payments\Payment;
+use danog\MadelineProto\EventHandler\Payments\StarGift;
use danog\MadelineProto\EventHandler\Pinned;
use danog\MadelineProto\EventHandler\Pinned\PinnedChannelMessages;
use danog\MadelineProto\EventHandler\Pinned\PinnedGroupMessages;
@@ -128,6 +133,7 @@ use danog\MadelineProto\TL\Types\Button;
use danog\MadelineProto\UpdateHandlerType;
use danog\MadelineProto\VoIP\DiscardReason;
use danog\MadelineProto\VoIPController;
+use DialogGiftStars;
use Revolt\EventLoop;
use SplQueue;
use Throwable;
@@ -490,6 +496,7 @@ trait UpdateHandler
'updatePendingJoinRequests' => new PendingJoinRequests($this, $update),
'updateBotChatInviteRequester' => new BotChatInviteRequest($this, $update),
'updateBotCommands' => new BotCommands($this, $update),
+ 'updateBotPrecheckoutQuery' => new Payment($this, $update),
default => null
};
} catch (\Throwable $e) {
@@ -684,6 +691,37 @@ trait UpdateHandler
$message['action']['text'],
null
),
+ 'messageActionGiftStars' => new DialogGiftStars(
+ $this,
+ $message,
+ $info,
+ $message['action']['currency'],
+ $message['action']['amount'],
+ $message['action']['stars'],
+ $message['action']['crypto_currency'] ?? null,
+ $message['action']['crypto_amount'] ?? null,
+ $message['action']['transaction_id'],
+ ),
+ 'messageActionStarGift' => new DialogStarGift(
+ $this,
+ $message,
+ $info,
+ $message['action']['name_hidden'] ?? null,
+ $message['action']['saved'] ?? null,
+ $message['action']['converted'] ?? null,
+ new StarGift(
+ $this,
+ $message['action']['gift']
+ ),
+ isset($message['action']['message']) ? new TextWithEntities(
+ $message['action']['message']['text'],
+ MessageEntity::fromRawEntities($message['action']['message']['entities']),
+ isset($message['action']['message']['parse_mode']) ?
+ ParseMode::from($message['action']['message']['parse_mode'])
+ : null
+ ) : null,
+ $message['action']['convert_stars'],
+ ),
'messageActionGiftPremium' => new DialogGiftPremium(
$this,
$message,
diff --git a/src/Namespace/Account.php b/src/Namespace/Account.php
index 63d13aa56..c7461ae90 100644
--- a/src/Namespace/Account.php
+++ b/src/Namespace/Account.php
@@ -137,23 +137,23 @@ interface Account
/**
* Get privacy settings of current account.
*
- * @param array{_: 'inputPrivacyKeyStatusTimestamp'}|array{_: 'inputPrivacyKeyChatInvite'}|array{_: 'inputPrivacyKeyPhoneCall'}|array{_: 'inputPrivacyKeyPhoneP2P'}|array{_: 'inputPrivacyKeyForwards'}|array{_: 'inputPrivacyKeyProfilePhoto'}|array{_: 'inputPrivacyKeyPhoneNumber'}|array{_: 'inputPrivacyKeyAddedByPhone'}|array{_: 'inputPrivacyKeyVoiceMessages'}|array{_: 'inputPrivacyKeyAbout'}|array{_: 'inputPrivacyKeyBirthday'} $key Peer category whose privacy settings should be fetched @see https://docs.madelineproto.xyz/API_docs/types/InputPrivacyKey.html
+ * @param array{_: 'inputPrivacyKeyStatusTimestamp'}|array{_: 'inputPrivacyKeyChatInvite'}|array{_: 'inputPrivacyKeyPhoneCall'}|array{_: 'inputPrivacyKeyPhoneP2P'}|array{_: 'inputPrivacyKeyForwards'}|array{_: 'inputPrivacyKeyProfilePhoto'}|array{_: 'inputPrivacyKeyPhoneNumber'}|array{_: 'inputPrivacyKeyAddedByPhone'}|array{_: 'inputPrivacyKeyVoiceMessages'}|array{_: 'inputPrivacyKeyAbout'}|array{_: 'inputPrivacyKeyBirthday'}|array{_: 'inputPrivacyKeyStarGiftsAutoSave'} $key Peer category whose privacy settings should be fetched @see https://docs.madelineproto.xyz/API_docs/types/InputPrivacyKey.html
* @param ?int $floodWaitLimit Can be used to specify a custom flood wait limit: if a FLOOD_WAIT_ rate limiting error is received with a waiting period bigger than this integer, an RPCErrorException will be thrown; otherwise, MadelineProto will simply wait for the specified amount of time. Defaults to the value specified in the settings: https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/RPC.html#setfloodtimeout-int-floodtimeout-self
* @param ?string $queueId If specified, ensures strict server-side execution order of concurrent calls with the same queue ID.
* @param ?\Amp\Cancellation $cancellation Cancellation
- * @return array{_: 'account.privacyRules', rules: list}|array{_: 'privacyValueDisallowContacts'}|array{_: 'privacyValueDisallowAll'}|array{_: 'privacyValueDisallowUsers', users: list}|array{_: 'privacyValueAllowChatParticipants', chats: list}|array{_: 'privacyValueDisallowChatParticipants', chats: list}|array{_: 'privacyValueAllowCloseFriends'}|array{_: 'privacyValueAllowPremium'}>, chats: list, users: list} @see https://docs.madelineproto.xyz/API_docs/types/account.PrivacyRules.html
+ * @return array{_: 'account.privacyRules', rules: list}|array{_: 'privacyValueDisallowContacts'}|array{_: 'privacyValueDisallowAll'}|array{_: 'privacyValueDisallowUsers', users: list}|array{_: 'privacyValueAllowChatParticipants', chats: list}|array{_: 'privacyValueDisallowChatParticipants', chats: list}|array{_: 'privacyValueAllowCloseFriends'}|array{_: 'privacyValueAllowPremium'}|array{_: 'privacyValueAllowBots'}|array{_: 'privacyValueDisallowBots'}>, chats: list, users: list} @see https://docs.madelineproto.xyz/API_docs/types/account.PrivacyRules.html
*/
public function getPrivacy(array $key, ?int $floodWaitLimit = null, ?string $queueId = null, ?\Amp\Cancellation $cancellation = null): array;
/**
* Change privacy settings of current account.
*
- * @param array{_: 'inputPrivacyKeyStatusTimestamp'}|array{_: 'inputPrivacyKeyChatInvite'}|array{_: 'inputPrivacyKeyPhoneCall'}|array{_: 'inputPrivacyKeyPhoneP2P'}|array{_: 'inputPrivacyKeyForwards'}|array{_: 'inputPrivacyKeyProfilePhoto'}|array{_: 'inputPrivacyKeyPhoneNumber'}|array{_: 'inputPrivacyKeyAddedByPhone'}|array{_: 'inputPrivacyKeyVoiceMessages'}|array{_: 'inputPrivacyKeyAbout'}|array{_: 'inputPrivacyKeyBirthday'} $key New privacy rule @see https://docs.madelineproto.xyz/API_docs/types/InputPrivacyKey.html
- * @param list}|array{_: 'inputPrivacyValueDisallowContacts'}|array{_: 'inputPrivacyValueDisallowAll'}|array{_: 'inputPrivacyValueDisallowUsers', users?: list}|array{_: 'inputPrivacyValueAllowChatParticipants', chats?: list}|array{_: 'inputPrivacyValueDisallowChatParticipants', chats?: list}|array{_: 'inputPrivacyValueAllowCloseFriends'}|array{_: 'inputPrivacyValueAllowPremium'}>|array $rules Array of Peers to which the privacy rule will apply. @see https://docs.madelineproto.xyz/API_docs/types/InputPrivacyRule.html
+ * @param array{_: 'inputPrivacyKeyStatusTimestamp'}|array{_: 'inputPrivacyKeyChatInvite'}|array{_: 'inputPrivacyKeyPhoneCall'}|array{_: 'inputPrivacyKeyPhoneP2P'}|array{_: 'inputPrivacyKeyForwards'}|array{_: 'inputPrivacyKeyProfilePhoto'}|array{_: 'inputPrivacyKeyPhoneNumber'}|array{_: 'inputPrivacyKeyAddedByPhone'}|array{_: 'inputPrivacyKeyVoiceMessages'}|array{_: 'inputPrivacyKeyAbout'}|array{_: 'inputPrivacyKeyBirthday'}|array{_: 'inputPrivacyKeyStarGiftsAutoSave'} $key New privacy rule @see https://docs.madelineproto.xyz/API_docs/types/InputPrivacyKey.html
+ * @param list}|array{_: 'inputPrivacyValueDisallowContacts'}|array{_: 'inputPrivacyValueDisallowAll'}|array{_: 'inputPrivacyValueDisallowUsers', users?: list}|array{_: 'inputPrivacyValueAllowChatParticipants', chats?: list}|array{_: 'inputPrivacyValueDisallowChatParticipants', chats?: list}|array{_: 'inputPrivacyValueAllowCloseFriends'}|array{_: 'inputPrivacyValueAllowPremium'}|array{_: 'inputPrivacyValueAllowBots'}|array{_: 'inputPrivacyValueDisallowBots'}>|array $rules Array of Peers to which the privacy rule will apply. @see https://docs.madelineproto.xyz/API_docs/types/InputPrivacyRule.html
* @param ?int $floodWaitLimit Can be used to specify a custom flood wait limit: if a FLOOD_WAIT_ rate limiting error is received with a waiting period bigger than this integer, an RPCErrorException will be thrown; otherwise, MadelineProto will simply wait for the specified amount of time. Defaults to the value specified in the settings: https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/RPC.html#setfloodtimeout-int-floodtimeout-self
* @param ?string $queueId If specified, ensures strict server-side execution order of concurrent calls with the same queue ID.
* @param ?\Amp\Cancellation $cancellation Cancellation
- * @return array{_: 'account.privacyRules', rules: list}|array{_: 'privacyValueDisallowContacts'}|array{_: 'privacyValueDisallowAll'}|array{_: 'privacyValueDisallowUsers', users: list}|array{_: 'privacyValueAllowChatParticipants', chats: list}|array{_: 'privacyValueDisallowChatParticipants', chats: list}|array{_: 'privacyValueAllowCloseFriends'}|array{_: 'privacyValueAllowPremium'}>, chats: list, users: list} @see https://docs.madelineproto.xyz/API_docs/types/account.PrivacyRules.html
+ * @return array{_: 'account.privacyRules', rules: list}|array{_: 'privacyValueDisallowContacts'}|array{_: 'privacyValueDisallowAll'}|array{_: 'privacyValueDisallowUsers', users: list}|array{_: 'privacyValueAllowChatParticipants', chats: list}|array{_: 'privacyValueDisallowChatParticipants', chats: list}|array{_: 'privacyValueAllowCloseFriends'}|array{_: 'privacyValueAllowPremium'}|array{_: 'privacyValueAllowBots'}|array{_: 'privacyValueDisallowBots'}>, chats: list, users: list} @see https://docs.madelineproto.xyz/API_docs/types/account.PrivacyRules.html
*/
public function setPrivacy(array $key, array $rules = [], ?int $floodWaitLimit = null, ?string $queueId = null, ?\Amp\Cancellation $cancellation = null): array;
diff --git a/src/Namespace/Bots.php b/src/Namespace/Bots.php
index a6dab94b9..144c7dd8f 100644
--- a/src/Namespace/Bots.php
+++ b/src/Namespace/Bots.php
@@ -272,4 +272,35 @@ interface Bots
* @return list, video_sizes?: list, dc_id: array}, ttl_seconds?: int}|array{_: 'messageMediaGeo', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}}|array{_: 'messageMediaContact', phone_number: string, first_name: string, last_name: string, vcard: string, user_id: int}|array{_: 'messageMediaUnsupported'}|array{_: 'messageMediaDocument', nopremium: bool, spoiler: bool, video: bool, round: bool, voice: bool, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, alt_documents?: list, video_thumbs?: list, dc_id: array, attributes: list}>, ttl_seconds?: int}|array{_: 'messageMediaWebPage', force_large_media: bool, force_small_media: bool, manual: bool, safe: bool, webpage: array{_: 'webPageEmpty', id: array, url?: array}|array{_: 'webPagePending', id: array, url?: array, date: array}|array{_: 'webPage', has_large_media: array, id: array, url: array, display_url: array, hash: array, type?: array, site_name?: array, title?: array, description?: array, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, embed_url?: array, embed_type?: array, embed_width?: array, embed_height?: array, duration?: array, author?: array, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, cached_page?: array, attributes?: list}|array{_: 'webPageNotModified', cached_page_views?: array}}|array{_: 'messageMediaVenue', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, title: string, address: string, provider: string, venue_id: string, venue_type: string}|array{_: 'messageMediaGame', game: array{_: 'game', id: array, access_hash: array, short_name: array, title: array, description: array, photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}}}|array{_: 'messageMediaInvoice', shipping_address_requested: bool, test: bool, title: string, description: string, photo?: array{_: 'webDocument', url: array, access_hash: array, size: array, mime_type: array, attributes: list}|array{_: 'webDocumentNoProxy', url: array, size: array, mime_type: array, attributes: list}, receipt_msg_id?: int, currency: string, total_amount: int, start_param: string, extended_media?: array{_: 'messageExtendedMediaPreview', w?: array, h?: array, thumb?: array, video_duration?: array}}|array{_: 'messageMediaGeoLive', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, heading?: int, period: int, proximity_notification_radius?: int}|array{_: 'messageMediaPoll', poll: array{_: 'poll', question: array, id: array, closed: array, public_voters: array, multiple_choice: array, quiz: array, answers: list, close_period?: array, close_date?: array}, results: array{_: 'pollResults', min: array, results?: list, total_voters?: array, recent_voters?: list, solution?: array, solution_entities?: list}}|array{_: 'messageMediaDice', value: int, emoticon: string}|array{_: 'messageMediaStory', peer: array|int|string, via_mention: bool, id: int, story?: array{_: 'storyItemDeleted', id: array}|array{_: 'storyItemSkipped', close_friends: array, id: array, date: array, expire_date: array}}|array{_: 'messageMediaGiveaway', only_new_subscribers: bool, winners_are_visible: bool, channels: list, countries_iso2?: list, prize_description?: string, quantity: int, months?: int, stars?: int, until_date: int}|array{_: 'messageMediaGiveawayResults', only_new_subscribers: bool, refunded: bool, channel_id: int, additional_peers_count?: int, launch_msg_id: int, winners_count: int, unclaimed_count: int, winners: list, months?: int, stars?: int, prize_description?: string, until_date: int}|array{_: 'messageMediaPaidMedia', stars_amount: int, extended_media: list}}> Array of @see https://docs.madelineproto.xyz/API_docs/types/BotPreviewMedia.html
*/
public function getPreviewMedias(array|int|string|null $bot = null, ?int $floodWaitLimit = null, ?string $queueId = null, ?\Amp\Cancellation $cancellation = null): array;
+
+ /**
+ *
+ *
+ * @param array|int|string $user_id @see https://docs.madelineproto.xyz/API_docs/types/InputUser.html
+ * @param array{_: 'emojiStatusEmpty'}|array{_: 'emojiStatus', document_id?: int}|array{_: 'emojiStatusUntil', document_id?: int, until?: int} $emoji_status @see https://docs.madelineproto.xyz/API_docs/types/EmojiStatus.html
+ * @param ?int $floodWaitLimit Can be used to specify a custom flood wait limit: if a FLOOD_WAIT_ rate limiting error is received with a waiting period bigger than this integer, an RPCErrorException will be thrown; otherwise, MadelineProto will simply wait for the specified amount of time. Defaults to the value specified in the settings: https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/RPC.html#setfloodtimeout-int-floodtimeout-self
+ * @param ?string $queueId If specified, ensures strict server-side execution order of concurrent calls with the same queue ID.
+ * @param ?\Amp\Cancellation $cancellation Cancellation
+ */
+ public function updateUserEmojiStatus(array|int|string|null $user_id = null, array|null $emoji_status = null, ?int $floodWaitLimit = null, ?string $queueId = null, ?\Amp\Cancellation $cancellation = null): bool;
+
+ /**
+ *
+ *
+ * @param array|int|string $bot @see https://docs.madelineproto.xyz/API_docs/types/InputUser.html
+ * @param ?int $floodWaitLimit Can be used to specify a custom flood wait limit: if a FLOOD_WAIT_ rate limiting error is received with a waiting period bigger than this integer, an RPCErrorException will be thrown; otherwise, MadelineProto will simply wait for the specified amount of time. Defaults to the value specified in the settings: https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/RPC.html#setfloodtimeout-int-floodtimeout-self
+ * @param ?string $queueId If specified, ensures strict server-side execution order of concurrent calls with the same queue ID.
+ * @param ?\Amp\Cancellation $cancellation Cancellation
+ */
+ public function toggleUserEmojiStatusPermission(bool $enabled, array|int|string|null $bot = null, ?int $floodWaitLimit = null, ?string $queueId = null, ?\Amp\Cancellation $cancellation = null): bool;
+
+ /**
+ *
+ *
+ * @param array|int|string $bot @see https://docs.madelineproto.xyz/API_docs/types/InputUser.html
+ * @param ?int $floodWaitLimit Can be used to specify a custom flood wait limit: if a FLOOD_WAIT_ rate limiting error is received with a waiting period bigger than this integer, an RPCErrorException will be thrown; otherwise, MadelineProto will simply wait for the specified amount of time. Defaults to the value specified in the settings: https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/RPC.html#setfloodtimeout-int-floodtimeout-self
+ * @param ?string $queueId If specified, ensures strict server-side execution order of concurrent calls with the same queue ID.
+ * @param ?\Amp\Cancellation $cancellation Cancellation
+ */
+ public function checkDownloadFileParams(array|int|string|null $bot = null, string|null $file_name = '', string|null $url = '', ?int $floodWaitLimit = null, ?string $queueId = null, ?\Amp\Cancellation $cancellation = null): bool;
}
diff --git a/src/Namespace/Channels.php b/src/Namespace/Channels.php
index 057431c6d..312243adc 100644
--- a/src/Namespace/Channels.php
+++ b/src/Namespace/Channels.php
@@ -420,27 +420,6 @@ interface Channels
*/
public function convertToGigagroup(array|int|string|null $channel = null, ?int $floodWaitLimit = null, ?string $queueId = null, ?\Amp\Cancellation $cancellation = null): array;
- /**
- * Mark a specific sponsored message as read.
- *
- * @param array|int|string $channel Peer @see https://docs.madelineproto.xyz/API_docs/types/InputChannel.html
- * @param ?int $floodWaitLimit Can be used to specify a custom flood wait limit: if a FLOOD_WAIT_ rate limiting error is received with a waiting period bigger than this integer, an RPCErrorException will be thrown; otherwise, MadelineProto will simply wait for the specified amount of time. Defaults to the value specified in the settings: https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/RPC.html#setfloodtimeout-int-floodtimeout-self
- * @param ?string $queueId If specified, ensures strict server-side execution order of concurrent calls with the same queue ID.
- * @param ?\Amp\Cancellation $cancellation Cancellation
- */
- public function viewSponsoredMessage(array|int|string|null $channel = null, ?int $floodWaitLimit = null, ?string $queueId = null, ?\Amp\Cancellation $cancellation = null): bool;
-
- /**
- * Get a list of sponsored messages.
- *
- * @param array|int|string $channel Peer @see https://docs.madelineproto.xyz/API_docs/types/InputChannel.html
- * @param ?int $floodWaitLimit Can be used to specify a custom flood wait limit: if a FLOOD_WAIT_ rate limiting error is received with a waiting period bigger than this integer, an RPCErrorException will be thrown; otherwise, MadelineProto will simply wait for the specified amount of time. Defaults to the value specified in the settings: https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/RPC.html#setfloodtimeout-int-floodtimeout-self
- * @param ?string $queueId If specified, ensures strict server-side execution order of concurrent calls with the same queue ID.
- * @param ?\Amp\Cancellation $cancellation Cancellation
- * @return array{_: 'messages.sponsoredMessages', posts_between?: int, messages: list, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, media?: array{_: 'messageMediaEmpty'}|array{_: 'messageMediaPhoto', spoiler: bool, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, ttl_seconds?: int}|array{_: 'messageMediaGeo', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}}|array{_: 'messageMediaContact', phone_number: string, first_name: string, last_name: string, vcard: string, user_id: int}|array{_: 'messageMediaUnsupported'}|array{_: 'messageMediaDocument', nopremium: bool, spoiler: bool, video: bool, round: bool, voice: bool, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, alt_documents?: list, video_thumbs?: list, dc_id: array, attributes: list}>, ttl_seconds?: int}|array{_: 'messageMediaWebPage', force_large_media: bool, force_small_media: bool, manual: bool, safe: bool, webpage: array{_: 'webPageEmpty', id: array, url?: array}|array{_: 'webPagePending', id: array, url?: array, date: array}|array{_: 'webPage', has_large_media: array, id: array, url: array, display_url: array, hash: array, type?: array, site_name?: array, title?: array, description?: array, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, embed_url?: array, embed_type?: array, embed_width?: array, embed_height?: array, duration?: array, author?: array, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, cached_page?: array, attributes?: list}|array{_: 'webPageNotModified', cached_page_views?: array}}|array{_: 'messageMediaVenue', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, title: string, address: string, provider: string, venue_id: string, venue_type: string}|array{_: 'messageMediaGame', game: array{_: 'game', id: array, access_hash: array, short_name: array, title: array, description: array, photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}}}|array{_: 'messageMediaInvoice', shipping_address_requested: bool, test: bool, title: string, description: string, photo?: array{_: 'webDocument', url: array, access_hash: array, size: array, mime_type: array, attributes: list}|array{_: 'webDocumentNoProxy', url: array, size: array, mime_type: array, attributes: list}, receipt_msg_id?: int, currency: string, total_amount: int, start_param: string, extended_media?: array{_: 'messageExtendedMediaPreview', w?: array, h?: array, thumb?: array, video_duration?: array}}|array{_: 'messageMediaGeoLive', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, heading?: int, period: int, proximity_notification_radius?: int}|array{_: 'messageMediaPoll', poll: array{_: 'poll', question: array, id: array, closed: array, public_voters: array, multiple_choice: array, quiz: array, answers: list, close_period?: array, close_date?: array}, results: array{_: 'pollResults', min: array, results?: list, total_voters?: array, recent_voters?: list, solution?: array, solution_entities?: list}}|array{_: 'messageMediaDice', value: int, emoticon: string}|array{_: 'messageMediaStory', peer: array|int|string, via_mention: bool, id: int, story?: array{_: 'storyItemDeleted', id: array}|array{_: 'storyItemSkipped', close_friends: array, id: array, date: array, expire_date: array}}|array{_: 'messageMediaGiveaway', only_new_subscribers: bool, winners_are_visible: bool, channels: list, countries_iso2?: list, prize_description?: string, quantity: int, months?: int, stars?: int, until_date: int}|array{_: 'messageMediaGiveawayResults', only_new_subscribers: bool, refunded: bool, channel_id: int, additional_peers_count?: int, launch_msg_id: int, winners_count: int, unclaimed_count: int, winners: list, months?: int, stars?: int, prize_description?: string, until_date: int}|array{_: 'messageMediaPaidMedia', stars_amount: int, extended_media: list}, color?: array{_: 'peerColor', color?: int, background_emoji_id?: int}, button_text: string, sponsor_info?: string, additional_info?: string}>, chats: list, users: list}|array{_: 'messages.sponsoredMessagesEmpty'} @see https://docs.madelineproto.xyz/API_docs/types/messages.SponsoredMessages.html
- */
- public function getSponsoredMessages(array|int|string|null $channel = null, ?int $floodWaitLimit = null, ?string $queueId = null, ?\Amp\Cancellation $cancellation = null): array;
-
/**
* Obtains a list of peers that can be used to send messages in a specific group.
*
@@ -560,7 +539,7 @@ interface Channels
* @param ?int $floodWaitLimit Can be used to specify a custom flood wait limit: if a FLOOD_WAIT_ rate limiting error is received with a waiting period bigger than this integer, an RPCErrorException will be thrown; otherwise, MadelineProto will simply wait for the specified amount of time. Defaults to the value specified in the settings: https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/RPC.html#setfloodtimeout-int-floodtimeout-self
* @param ?string $queueId If specified, ensures strict server-side execution order of concurrent calls with the same queue ID.
* @param ?\Amp\Cancellation $cancellation Cancellation
- * @return array{_: 'messages.forumTopics', order_by_create_date: bool, count: int, topics: list, quote_offset?: int}|array{_: 'inputReplyToStory', peer: array|int|string, story_id: int}, message: string, entities?: list, media?: \danog\MadelineProto\EventHandler\Media|string|array, date: int, effect?: int}}>, messages: list, video_sizes?: list, dc_id: array}, ttl_seconds?: int}|array{_: 'messageMediaGeo', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}}|array{_: 'messageMediaContact', phone_number: string, first_name: string, last_name: string, vcard: string, user_id: int}|array{_: 'messageMediaUnsupported'}|array{_: 'messageMediaDocument', nopremium: bool, spoiler: bool, video: bool, round: bool, voice: bool, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, alt_documents?: list, video_thumbs?: list, dc_id: array, attributes: list}>, ttl_seconds?: int}|array{_: 'messageMediaWebPage', force_large_media: bool, force_small_media: bool, manual: bool, safe: bool, webpage: array{_: 'webPageEmpty', id: array, url?: array}|array{_: 'webPagePending', id: array, url?: array, date: array}|array{_: 'webPage', has_large_media: array, id: array, url: array, display_url: array, hash: array, type?: array, site_name?: array, title?: array, description?: array, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, embed_url?: array, embed_type?: array, embed_width?: array, embed_height?: array, duration?: array, author?: array, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, cached_page?: array, attributes?: list}|array{_: 'webPageNotModified', cached_page_views?: array}}|array{_: 'messageMediaVenue', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, title: string, address: string, provider: string, venue_id: string, venue_type: string}|array{_: 'messageMediaGame', game: array{_: 'game', id: array, access_hash: array, short_name: array, title: array, description: array, photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}}}|array{_: 'messageMediaInvoice', shipping_address_requested: bool, test: bool, title: string, description: string, photo?: array{_: 'webDocument', url: array, access_hash: array, size: array, mime_type: array, attributes: list}|array{_: 'webDocumentNoProxy', url: array, size: array, mime_type: array, attributes: list}, receipt_msg_id?: int, currency: string, total_amount: int, start_param: string, extended_media?: array{_: 'messageExtendedMediaPreview', w?: array, h?: array, thumb?: array, video_duration?: array}}|array{_: 'messageMediaGeoLive', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, heading?: int, period: int, proximity_notification_radius?: int}|array{_: 'messageMediaPoll', poll: array{_: 'poll', question: array, id: array, closed: array, public_voters: array, multiple_choice: array, quiz: array, answers: list, close_period?: array, close_date?: array}, results: array{_: 'pollResults', min: array, results?: list, total_voters?: array, recent_voters?: list, solution?: array, solution_entities?: list}}|array{_: 'messageMediaDice', value: int, emoticon: string}|array{_: 'messageMediaStory', peer: array|int|string, via_mention: bool, id: int, story?: array{_: 'storyItemDeleted', id: array}|array{_: 'storyItemSkipped', close_friends: array, id: array, date: array, expire_date: array}}|array{_: 'messageMediaGiveaway', only_new_subscribers: bool, winners_are_visible: bool, channels: list, countries_iso2?: list, prize_description?: string, quantity: int, months?: int, stars?: int, until_date: int}|array{_: 'messageMediaGiveawayResults', only_new_subscribers: bool, refunded: bool, channel_id: int, additional_peers_count?: int, launch_msg_id: int, winners_count: int, unclaimed_count: int, winners: list, months?: int, stars?: int, prize_description?: string, until_date: int}|array{_: 'messageMediaPaidMedia', stars_amount: int, extended_media: list}, reply_to_top_id?: int, quote_text?: string, quote_entities?: list, quote_offset?: int}|array{_: 'messageReplyStoryHeader', peer: array|int|string, story_id: int}, date: int, message: string, media?: array{_: 'messageMediaEmpty'}|array{_: 'messageMediaPhoto', spoiler: bool, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, ttl_seconds?: int}|array{_: 'messageMediaGeo', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}}|array{_: 'messageMediaContact', phone_number: string, first_name: string, last_name: string, vcard: string, user_id: int}|array{_: 'messageMediaUnsupported'}|array{_: 'messageMediaDocument', nopremium: bool, spoiler: bool, video: bool, round: bool, voice: bool, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, alt_documents?: list, video_thumbs?: list, dc_id: array, attributes: list}>, ttl_seconds?: int}|array{_: 'messageMediaWebPage', force_large_media: bool, force_small_media: bool, manual: bool, safe: bool, webpage: array{_: 'webPageEmpty', id: array, url?: array}|array{_: 'webPagePending', id: array, url?: array, date: array}|array{_: 'webPage', has_large_media: array, id: array, url: array, display_url: array, hash: array, type?: array, site_name?: array, title?: array, description?: array, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, embed_url?: array, embed_type?: array, embed_width?: array, embed_height?: array, duration?: array, author?: array, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, cached_page?: array, attributes?: list}|array{_: 'webPageNotModified', cached_page_views?: array}}|array{_: 'messageMediaVenue', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, title: string, address: string, provider: string, venue_id: string, venue_type: string}|array{_: 'messageMediaGame', game: array{_: 'game', id: array, access_hash: array, short_name: array, title: array, description: array, photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}}}|array{_: 'messageMediaInvoice', shipping_address_requested: bool, test: bool, title: string, description: string, photo?: array{_: 'webDocument', url: array, access_hash: array, size: array, mime_type: array, attributes: list}|array{_: 'webDocumentNoProxy', url: array, size: array, mime_type: array, attributes: list}, receipt_msg_id?: int, currency: string, total_amount: int, start_param: string, extended_media?: array{_: 'messageExtendedMediaPreview', w?: array, h?: array, thumb?: array, video_duration?: array}}|array{_: 'messageMediaGeoLive', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, heading?: int, period: int, proximity_notification_radius?: int}|array{_: 'messageMediaPoll', poll: array{_: 'poll', question: array, id: array, closed: array, public_voters: array, multiple_choice: array, quiz: array, answers: list, close_period?: array, close_date?: array}, results: array{_: 'pollResults', min: array, results?: list, total_voters?: array, recent_voters?: list, solution?: array, solution_entities?: list}}|array{_: 'messageMediaDice', value: int, emoticon: string}|array{_: 'messageMediaStory', peer: array|int|string, via_mention: bool, id: int, story?: array{_: 'storyItemDeleted', id: array}|array{_: 'storyItemSkipped', close_friends: array, id: array, date: array, expire_date: array}}|array{_: 'messageMediaGiveaway', only_new_subscribers: bool, winners_are_visible: bool, channels: list, countries_iso2?: list, prize_description?: string, quantity: int, months?: int, stars?: int, until_date: int}|array{_: 'messageMediaGiveawayResults', only_new_subscribers: bool, refunded: bool, channel_id: int, additional_peers_count?: int, launch_msg_id: int, winners_count: int, unclaimed_count: int, winners: list, months?: int, stars?: int, prize_description?: string, until_date: int}|array{_: 'messageMediaPaidMedia', stars_amount: int, extended_media: list}, reply_markup?: array, entities?: list, views?: int, forwards?: int, replies?: array{_: 'messageReplies', comments: bool, replies: int, replies_pts: int, recent_repliers?: list, channel_id?: int, max_id?: int, read_max_id?: int}, edit_date?: int, post_author?: string, grouped_id?: int, reactions?: array{_: 'messageReactions', min: bool, can_see_list: bool, reactions_as_tags: bool, results: list, recent_reactions?: list, top_reactors?: list}, restriction_reason?: list, ttl_period?: int, quick_reply_shortcut_id?: int, effect?: int, factcheck?: array{_: 'factCheck', need_check: bool, country?: string, text?: array{_: 'textWithEntities', text: string, entities: list}, hash: list}}|array{_: 'messageService', peer_id: array|int|string, out: bool, mentioned: bool, media_unread: bool, silent: bool, post: bool, legacy: bool, id: int, from_id?: array|int|string, reply_to?: array{_: 'messageReplyHeader', reply_to_scheduled: bool, forum_topic: bool, quote: bool, reply_to_msg_id?: int, reply_to_peer_id?: array|int|string, reply_from?: array{_: 'messageFwdHeader', imported: bool, saved_out: bool, from_id?: array|int|string, from_name?: string, date: int, channel_post?: int, post_author?: string, saved_from_peer?: array|int|string, saved_from_msg_id?: int, saved_from_id?: array|int|string, saved_from_name?: string, saved_date?: int, psa_type?: string}, reply_media?: array{_: 'messageMediaEmpty'}|array{_: 'messageMediaPhoto', spoiler: bool, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, ttl_seconds?: int}|array{_: 'messageMediaGeo', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}}|array{_: 'messageMediaContact', phone_number: string, first_name: string, last_name: string, vcard: string, user_id: int}|array{_: 'messageMediaUnsupported'}|array{_: 'messageMediaDocument', nopremium: bool, spoiler: bool, video: bool, round: bool, voice: bool, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, alt_documents?: list, video_thumbs?: list, dc_id: array, attributes: list}>, ttl_seconds?: int}|array{_: 'messageMediaWebPage', force_large_media: bool, force_small_media: bool, manual: bool, safe: bool, webpage: array{_: 'webPageEmpty', id: array, url?: array}|array{_: 'webPagePending', id: array, url?: array, date: array}|array{_: 'webPage', has_large_media: array, id: array, url: array, display_url: array, hash: array, type?: array, site_name?: array, title?: array, description?: array, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, embed_url?: array, embed_type?: array, embed_width?: array, embed_height?: array, duration?: array, author?: array, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, cached_page?: array, attributes?: list}|array{_: 'webPageNotModified', cached_page_views?: array}}|array{_: 'messageMediaVenue', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, title: string, address: string, provider: string, venue_id: string, venue_type: string}|array{_: 'messageMediaGame', game: array{_: 'game', id: array, access_hash: array, short_name: array, title: array, description: array, photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}}}|array{_: 'messageMediaInvoice', shipping_address_requested: bool, test: bool, title: string, description: string, photo?: array{_: 'webDocument', url: array, access_hash: array, size: array, mime_type: array, attributes: list}|array{_: 'webDocumentNoProxy', url: array, size: array, mime_type: array, attributes: list}, receipt_msg_id?: int, currency: string, total_amount: int, start_param: string, extended_media?: array{_: 'messageExtendedMediaPreview', w?: array, h?: array, thumb?: array, video_duration?: array}}|array{_: 'messageMediaGeoLive', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}, heading?: int, period: int, proximity_notification_radius?: int}|array{_: 'messageMediaPoll', poll: array{_: 'poll', question: array, id: array, closed: array, public_voters: array, multiple_choice: array, quiz: array, answers: list, close_period?: array, close_date?: array}, results: array{_: 'pollResults', min: array, results?: list, total_voters?: array, recent_voters?: list, solution?: array, solution_entities?: list}}|array{_: 'messageMediaDice', value: int, emoticon: string}|array{_: 'messageMediaStory', peer: array|int|string, via_mention: bool, id: int, story?: array{_: 'storyItemDeleted', id: array}|array{_: 'storyItemSkipped', close_friends: array, id: array, date: array, expire_date: array}}|array{_: 'messageMediaGiveaway', only_new_subscribers: bool, winners_are_visible: bool, channels: list, countries_iso2?: list, prize_description?: string, quantity: int, months?: int, stars?: int, until_date: int}|array{_: 'messageMediaGiveawayResults', only_new_subscribers: bool, refunded: bool, channel_id: int, additional_peers_count?: int, launch_msg_id: int, winners_count: int, unclaimed_count: int, winners: list, months?: int, stars?: int, prize_description?: string, until_date: int}|array{_: 'messageMediaPaidMedia', stars_amount: int, extended_media: list}, reply_to_top_id?: int, quote_text?: string, quote_entities?: list, quote_offset?: int}|array{_: 'messageReplyStoryHeader', peer: array|int|string, story_id: int}, date: int, action: array{_: 'messageActionEmpty'}|array{_: 'messageActionChatCreate', title: string, users: list}|array{_: 'messageActionChatEditTitle', title: string}|array{_: 'messageActionChatEditPhoto', photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}}|array{_: 'messageActionChatDeletePhoto'}|array{_: 'messageActionChatAddUser', users: list}|array{_: 'messageActionChatDeleteUser', user_id: int}|array{_: 'messageActionChatJoinedByLink', inviter_id: int}|array{_: 'messageActionChannelCreate', title: string}|array{_: 'messageActionChatMigrateTo', channel_id: int}|array{_: 'messageActionChannelMigrateFrom', title: string, chat_id: array|int|string}|array{_: 'messageActionPinMessage'}|array{_: 'messageActionHistoryClear'}|array{_: 'messageActionGameScore', game_id: int, score: int}|array{_: 'messageActionPaymentSentMe', charge: array{_: 'paymentCharge', id: string, provider_charge_id: string}, recurring_init: bool, recurring_used: bool, currency: string, total_amount: int, payload: string, info?: array{_: 'paymentRequestedInfo', name?: string, phone?: string, email?: string, shipping_address?: array{_: 'postAddress', street_line1: string, street_line2: string, city: string, state: string, country_iso2: string, post_code: string}}, shipping_option_id?: string}|array{_: 'messageActionPaymentSent', recurring_init: bool, recurring_used: bool, currency: string, total_amount: int, invoice_slug?: string}|array{_: 'messageActionPhoneCall', video: bool, call_id: int, reason?: array{_: 'phoneCallDiscardReasonMissed'}|array{_: 'phoneCallDiscardReasonDisconnect'}|array{_: 'phoneCallDiscardReasonHangup'}|array{_: 'phoneCallDiscardReasonBusy'}, duration?: int}|array{_: 'messageActionScreenshotTaken'}|array{_: 'messageActionCustomAction', message: string}|array{_: 'messageActionBotAllowed', attach_menu: bool, from_request: bool, domain?: string, app?: array{_: 'botAppNotModified'}|array{_: 'botApp', id: int, access_hash: int, short_name: string, title: string, description: string, photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, hash: list}}|array{_: 'messageActionSecureValuesSentMe', credentials: array{_: 'secureCredentialsEncrypted', data: string, hash: string, secret: string}, values: list, files?: list, plain_data?: array{_: 'securePlainPhone', phone: string}|array{_: 'securePlainEmail', email: string}, hash: string}>}|array{_: 'messageActionSecureValuesSent', types: list}|array{_: 'messageActionContactSignUp'}|array{_: 'messageActionGeoProximityReached', from_id: array|int|string, to_id: array|int|string, distance: int}|array{_: 'messageActionGroupCall', call: array{_: 'inputGroupCall', id: int, access_hash: int}, duration?: int}|array{_: 'messageActionInviteToGroupCall', call: array{_: 'inputGroupCall', id: int, access_hash: int}, users: list}|array{_: 'messageActionSetMessagesTTL', period: int, auto_setting_from?: int}|array{_: 'messageActionGroupCallScheduled', call: array{_: 'inputGroupCall', id: int, access_hash: int}, schedule_date: int}|array{_: 'messageActionSetChatTheme', emoticon: string}|array{_: 'messageActionChatJoinedByRequest'}|array{_: 'messageActionWebViewDataSentMe', text: string, data: string}|array{_: 'messageActionWebViewDataSent', text: string}|array{_: 'messageActionGiftPremium', currency: string, amount: int, months: int, crypto_currency?: string, crypto_amount?: int, message?: array{_: 'textWithEntities', text: string, entities: list}}|array{_: 'messageActionTopicCreate', title: string, icon_color: int, icon_emoji_id?: int}|array{_: 'messageActionTopicEdit', title?: string, icon_emoji_id?: int, closed?: bool, hidden?: bool}|array{_: 'messageActionSuggestProfilePhoto', photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}}|array{_: 'messageActionRequestedPeer', button_id: int, peers: list}|array{_: 'messageActionSetChatWallPaper', wallpaper: array{_: 'wallPaper', id: int, creator: bool, default: bool, pattern: bool, dark: bool, access_hash: int, slug: string, document: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, settings?: array{_: 'wallPaperSettings', blur: bool, motion: bool, background_color?: int, second_background_color?: int, third_background_color?: int, fourth_background_color?: int, intensity?: int, rotation?: int, emoticon?: string}}|array{_: 'wallPaperNoFile', id: int, default: bool, dark: bool, settings?: array{_: 'wallPaperSettings', blur: bool, motion: bool, background_color?: int, second_background_color?: int, third_background_color?: int, fourth_background_color?: int, intensity?: int, rotation?: int, emoticon?: string}}, same: bool, for_both: bool}|array{_: 'messageActionGiftCode', via_giveaway: bool, unclaimed: bool, boost_peer?: array|int|string, months: int, slug: string, currency?: string, amount?: int, crypto_currency?: string, crypto_amount?: int, message?: array{_: 'textWithEntities', text: string, entities: list}}|array{_: 'messageActionGiveawayLaunch', stars?: int}|array{_: 'messageActionGiveawayResults', stars: bool, winners_count: int, unclaimed_count: int}|array{_: 'messageActionBoostApply', boosts: int}|array{_: 'messageActionRequestedPeerSentMe', button_id: int, peers: list, video_sizes?: list, dc_id: array}}|array{_: 'requestedPeerChat', chat_id: array|int|string, title?: string, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}}|array{_: 'requestedPeerChannel', channel_id: int, title?: string, username?: string, photo?: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list, video_sizes?: list, dc_id: array}}>}|array{_: 'messageActionPaymentRefunded', peer: array|int|string, charge: array{_: 'paymentCharge', id: string, provider_charge_id: string}, currency: string, total_amount: int, payload?: string}|array{_: 'messageActionGiftStars', currency: string, amount: int, stars: int, crypto_currency?: string, crypto_amount?: int, transaction_id?: string}|array{_: 'messageActionPrizeStars', boost_peer: array|int|string, unclaimed: bool, stars: int, transaction_id: string, giveaway_msg_id: int}|array{_: 'messageActionStarGift', gift: array{_: 'starGift', limited: bool, id: int, sticker: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list}, stars: int, availability_remains?: int, availability_total?: int, convert_stars: int}, name_hidden: bool, saved: bool, converted: bool, message?: array{_: 'textWithEntities', text: string, entities: list}, convert_stars: int}, ttl_period?: int}>, chats: list, users: list, pts: int} @see https://docs.madelineproto.xyz/API_docs/types/messages.ForumTopics.html
+ * @return array{_: 'messages.forumTopics', order_by_create_date: bool, count: int, topics: list, quote_offset?: int}|array{_: 'inputReplyToStory', peer: array|int|string, story_id: int}, message: string, entities?: list, media?: \danog\MadelineProto\EventHandler\Media|string|array, date: int, effect?: int}}>, messages: list, video_sizes?: list, dc_id: array}, ttl_seconds?: int}|array{_: 'messageMediaGeo', geo: array{_: 'geoPointEmpty'}|array{_: 'geoPoint', long: array, lat: array, access_hash: array, accuracy_radius?: array}}|array{_: 'messageMediaContact', phone_number: string, first_name: string, last_name: string, vcard: string, user_id: int}|array{_: 'messageMediaUnsupported'}|array{_: 'messageMediaDocument', nopremium: bool, spoiler: bool, video: bool, round: bool, voice: bool, document?: array{_: 'documentEmpty', id: array}|array{_: 'document', id: array, access_hash: array, file_reference: array, date: array, mime_type: array, size: array, thumbs?: list, video_thumbs?: list, dc_id: array, attributes: list