mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 04:08:59 +01:00
Cleanup
This commit is contained in:
parent
afc082cc63
commit
ed97e81237
2
docs
2
docs
@ -1 +1 @@
|
||||
Subproject commit ab6676b13096b2396299f776726ceab3f7617628
|
||||
Subproject commit 202b075a02b8226a64f133305486934ee3def01f
|
@ -28,6 +28,8 @@ use danog\MadelineProto\Loop\InternalLoop;
|
||||
use danog\MadelineProto\MTProto;
|
||||
use danog\MadelineProto\PeerNotInDbException;
|
||||
use danog\MadelineProto\PTSException;
|
||||
use danog\MadelineProto\RPCError\ChannelPrivateError;
|
||||
use danog\MadelineProto\RPCError\ChatForbiddenError;
|
||||
use danog\MadelineProto\RPCErrorException;
|
||||
use Revolt\EventLoop;
|
||||
|
||||
|
@ -29,6 +29,7 @@ use danog\MadelineProto\Exception;
|
||||
use danog\MadelineProto\Logger;
|
||||
use danog\MadelineProto\Magic;
|
||||
use danog\MadelineProto\PeerNotInDbException;
|
||||
use danog\MadelineProto\RPCError\ChannelPrivateError;
|
||||
use danog\MadelineProto\RPCErrorException;
|
||||
use danog\MadelineProto\Settings;
|
||||
use danog\MadelineProto\Tools;
|
||||
@ -91,13 +92,12 @@ trait PeerHandler
|
||||
return $this->peerDatabase->isset($this->getIdInternal($id));
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
} catch (ChannelPrivateError) {
|
||||
return true;
|
||||
} catch (RPCErrorException $e) {
|
||||
if ($e->rpc === 'CHAT_FORBIDDEN') {
|
||||
return true;
|
||||
}
|
||||
if ($e->rpc === 'CHANNEL_PRIVATE') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -326,9 +326,6 @@ final class Magic
|
||||
self::$twoe1984 = new BigInteger('010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 16);
|
||||
self::$twoe2047 = new BigInteger('80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 16);
|
||||
self::$twoe2048 = new BigInteger('0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 16);
|
||||
$res = json_decode(file_get_contents(__DIR__.'/v3.json'), true);
|
||||
RPCErrorException::$errorMethodMap = $res['result'];
|
||||
RPCErrorException::$descriptions += $res['human_result'];
|
||||
foreach (Extension::ALL_MIMES as $ext => $mimes) {
|
||||
$ext = ".$ext";
|
||||
foreach ($mimes as $mime) {
|
||||
|
@ -220,10 +220,10 @@ class RPCErrorException extends \Exception
|
||||
): self {
|
||||
// Start match
|
||||
return match ($rpc) {
|
||||
'ADDRESS_INVALID' => new self($rpc, 'The specified geopoint address is invalid.', $code, $caller, $previous),
|
||||
'ABOUT_TOO_LONG' => new self($rpc, 'About string too long.', $code, $caller, $previous),
|
||||
'ACCESS_TOKEN_EXPIRED' => new self($rpc, 'Access token expired.', $code, $caller, $previous),
|
||||
'ACCESS_TOKEN_INVALID' => new self($rpc, 'Access token invalid.', $code, $caller, $previous),
|
||||
'ADDRESS_INVALID' => new self($rpc, 'The specified geopoint address is invalid.', $code, $caller, $previous),
|
||||
'ADMIN_ID_INVALID' => new self($rpc, 'The specified admin ID is invalid.', $code, $caller, $previous),
|
||||
'ADMIN_RANK_EMOJI_NOT_ALLOWED' => new self($rpc, 'An admin rank cannot contain emojis.', $code, $caller, $previous),
|
||||
'ADMIN_RANK_INVALID' => new self($rpc, 'The specified admin rank is invalid.', $code, $caller, $previous),
|
||||
@ -248,6 +248,7 @@ class RPCErrorException extends \Exception
|
||||
'BOOST_PEER_INVALID' => new self($rpc, 'The specified `boost_peer` is invalid.', $code, $caller, $previous),
|
||||
'BOOSTS_EMPTY' => new self($rpc, 'No boost slots were specified.', $code, $caller, $previous),
|
||||
'BOOSTS_REQUIRED' => new self($rpc, 'The specified channel must first be [boosted by its users](https://core.telegram.org/api/boost) in order to perform this action.', $code, $caller, $previous),
|
||||
'BOT_APP_BOT_INVALID' => new self($rpc, 'The bot_id passed in the inputBotAppShortName constructor is invalid.', $code, $caller, $previous),
|
||||
'BOT_APP_INVALID' => new self($rpc, 'The specified bot app is invalid.', $code, $caller, $previous),
|
||||
'BOT_APP_SHORTNAME_INVALID' => new self($rpc, 'The specified bot app short name is invalid.', $code, $caller, $previous),
|
||||
'BOT_CHANNELS_NA' => new self($rpc, 'Bots can\'t edit admin privileges.', $code, $caller, $previous),
|
||||
@ -306,13 +307,17 @@ class RPCErrorException extends \Exception
|
||||
'CHAT_SEND_INLINE_FORBIDDEN' => new self($rpc, 'You can\'t send inline messages in this group.', $code, $caller, $previous),
|
||||
'CHAT_TITLE_EMPTY' => new self($rpc, 'No chat title provided.', $code, $caller, $previous),
|
||||
'CHAT_TOO_BIG' => new self($rpc, 'This method is not available for groups with more than `chat_read_mark_size_threshold` members, [see client configuration »](https://core.telegram.org/api/config#client-configuration).', $code, $caller, $previous),
|
||||
'CHATLINK_SLUG_EMPTY' => new self($rpc, 'The specified slug is empty.', $code, $caller, $previous),
|
||||
'CHATLIST_EXCLUDE_INVALID' => new self($rpc, 'The specified `exclude_peers` are invalid.', $code, $caller, $previous),
|
||||
'CODE_EMPTY' => new self($rpc, 'The provided code is empty.', $code, $caller, $previous),
|
||||
'CODE_HASH_INVALID' => new self($rpc, 'Code hash invalid.', $code, $caller, $previous),
|
||||
'CODE_INVALID' => new self($rpc, 'Code invalid.', $code, $caller, $previous),
|
||||
'COLLECTIBLE_INVALID' => new self($rpc, 'The specified collectible is invalid.', $code, $caller, $previous),
|
||||
'COLLECTIBLE_NOT_FOUND' => new self($rpc, 'The specified collectible could not be found.', $code, $caller, $previous),
|
||||
'COLOR_INVALID' => new self($rpc, 'The specified color palette ID was invalid.', $code, $caller, $previous),
|
||||
'CONNECTION_API_ID_INVALID' => new self($rpc, 'The provided API id is invalid.', $code, $caller, $previous),
|
||||
'CONNECTION_APP_VERSION_EMPTY' => new self($rpc, 'App version is empty.', $code, $caller, $previous),
|
||||
'CONNECTION_ID_INVALID' => new self($rpc, 'The specified connection ID is invalid.', $code, $caller, $previous),
|
||||
'CONNECTION_LAYER_INVALID' => new self($rpc, 'Layer invalid.', $code, $caller, $previous),
|
||||
'CONTACT_ADD_MISSING' => new self($rpc, 'Contact to add is missing.', $code, $caller, $previous),
|
||||
'CONTACT_ID_INVALID' => new self($rpc, 'The provided contact ID is invalid.', $code, $caller, $previous),
|
||||
@ -399,7 +404,9 @@ class RPCErrorException extends \Exception
|
||||
'HIDE_REQUESTER_MISSING' => new self($rpc, 'The join request was missing or was already handled.', $code, $caller, $previous),
|
||||
'IMAGE_PROCESS_FAILED' => new \danog\MadelineProto\RPCError\ImageProcessFailedError($code, $caller, $previous),
|
||||
'IMPORT_FILE_INVALID' => new self($rpc, 'The specified chat export file is invalid.', $code, $caller, $previous),
|
||||
'IMPORT_FORMAT_DATE_INVALID' => new self($rpc, 'The date specified in the import file is invalid.', $code, $caller, $previous),
|
||||
'IMPORT_FORMAT_UNRECOGNIZED' => new self($rpc, 'The specified chat export file was exported from an unsupported chat app.', $code, $caller, $previous),
|
||||
'IMPORT_HISTORY_LOG_EMPTY' => new self($rpc, '', $code, $caller, $previous),
|
||||
'IMPORT_ID_INVALID' => new self($rpc, 'The specified import ID is invalid.', $code, $caller, $previous),
|
||||
'IMPORT_TOKEN_INVALID' => new self($rpc, 'The specified token is invalid.', $code, $caller, $previous),
|
||||
'INLINE_RESULT_EXPIRED' => new self($rpc, 'The inline query expired.', $code, $caller, $previous),
|
||||
@ -461,6 +468,8 @@ class RPCErrorException extends \Exception
|
||||
'NEW_SETTINGS_EMPTY' => new self($rpc, 'No password is set on the current account, and no new password was specified in `new_settings`.', $code, $caller, $previous),
|
||||
'NEW_SETTINGS_INVALID' => new self($rpc, 'The new password settings are invalid.', $code, $caller, $previous),
|
||||
'NEXT_OFFSET_INVALID' => new self($rpc, 'The specified offset is longer than 64 bytes.', $code, $caller, $previous),
|
||||
'NOT_ELIGIBLE' => new self($rpc, 'The current user is not eligible to join the Peer-to-Peer Login Program.', $code, $caller, $previous),
|
||||
'NOT_JOINED' => new self($rpc, 'The current user hasn\'t joined the Peer-to-Peer Login Program.', $code, $caller, $previous),
|
||||
'OFFSET_INVALID' => new self($rpc, 'The provided offset is invalid.', $code, $caller, $previous),
|
||||
'OFFSET_PEER_ID_INVALID' => new self($rpc, 'The provided offset peer is invalid.', $code, $caller, $previous),
|
||||
'OPTION_INVALID' => new self($rpc, 'Invalid option selected.', $code, $caller, $previous),
|
||||
@ -530,6 +539,8 @@ class RPCErrorException extends \Exception
|
||||
'QUIZ_CORRECT_ANSWERS_EMPTY' => new self($rpc, 'No correct quiz answer was specified.', $code, $caller, $previous),
|
||||
'QUIZ_CORRECT_ANSWERS_TOO_MUCH' => new \danog\MadelineProto\RPCError\QuizCorrectAnswersTooMuchError($code, $caller, $previous),
|
||||
'QUIZ_MULTIPLE_INVALID' => new self($rpc, 'Quizzes can\'t have the multiple_choice flag set!', $code, $caller, $previous),
|
||||
'QUOTE_TEXT_INVALID' => new self($rpc, 'The specified `reply_to`.`quote_text` field is invalid.', $code, $caller, $previous),
|
||||
'RAISE_HAND_FORBIDDEN' => new self($rpc, 'You cannot raise your hand.', $code, $caller, $previous),
|
||||
'RANDOM_ID_EMPTY' => new self($rpc, 'Random ID empty.', $code, $caller, $previous),
|
||||
'RANDOM_ID_INVALID' => new self($rpc, 'A provided random ID is invalid.', $code, $caller, $previous),
|
||||
'RANDOM_LENGTH_INVALID' => new self($rpc, 'Random length invalid.', $code, $caller, $previous),
|
||||
@ -538,11 +549,13 @@ class RPCErrorException extends \Exception
|
||||
'REACTION_INVALID' => new self($rpc, 'The specified reaction is invalid.', $code, $caller, $previous),
|
||||
'REACTIONS_TOO_MANY' => new self($rpc, 'The message already has exactly `reactions_uniq_max` reaction emojis, you can\'t react with a new emoji, see [the docs for more info »](/api/config#client-configuration).', $code, $caller, $previous),
|
||||
'REPLY_MARKUP_BUY_EMPTY' => new self($rpc, 'Reply markup for buy button empty.', $code, $caller, $previous),
|
||||
'REPLY_MARKUP_GAME_EMPTY' => new self($rpc, '', $code, $caller, $previous),
|
||||
'REPLY_MARKUP_INVALID' => new self($rpc, 'The provided reply markup is invalid.', $code, $caller, $previous),
|
||||
'REPLY_MARKUP_TOO_LONG' => new self($rpc, 'The specified reply_markup is too long.', $code, $caller, $previous),
|
||||
'REPLY_MESSAGE_ID_INVALID' => new self($rpc, 'The specified reply-to message ID is invalid.', $code, $caller, $previous),
|
||||
'REPLY_TO_INVALID' => new self($rpc, 'The specified `reply_to` field is invalid.', $code, $caller, $previous),
|
||||
'REPLY_TO_USER_INVALID' => new self($rpc, 'The replied-to user is invalid.', $code, $caller, $previous),
|
||||
'REQUEST_TOKEN_INVALID' => new self($rpc, 'The master DC did not accept the `request_token` from the CDN DC. Continue downloading the file from the master DC using upload.getFile.', $code, $caller, $previous),
|
||||
'RESET_REQUEST_MISSING' => new self($rpc, 'No password reset is in progress.', $code, $caller, $previous),
|
||||
'RESULT_ID_DUPLICATE' => new self($rpc, 'You provided a duplicate result ID.', $code, $caller, $previous),
|
||||
'RESULT_ID_EMPTY' => new self($rpc, 'Result ID empty.', $code, $caller, $previous),
|
||||
@ -568,10 +581,12 @@ class RPCErrorException extends \Exception
|
||||
'SHA256_HASH_INVALID' => new self($rpc, 'The provided SHA256 hash is invalid.', $code, $caller, $previous),
|
||||
'SHORT_NAME_INVALID' => new self($rpc, 'The specified short name is invalid.', $code, $caller, $previous),
|
||||
'SHORT_NAME_OCCUPIED' => new self($rpc, 'The specified short name is already in use.', $code, $caller, $previous),
|
||||
'SHORTCUT_INVALID' => new self($rpc, 'The specified shortcut is invalid.', $code, $caller, $previous),
|
||||
'SLOTS_EMPTY' => new self($rpc, 'The specified slot list is empty.', $code, $caller, $previous),
|
||||
'SLOWMODE_MULTI_MSGS_DISABLED' => new self($rpc, 'Slowmode is enabled, you cannot forward multiple messages to this group.', $code, $caller, $previous),
|
||||
'SLUG_INVALID' => new self($rpc, 'The specified invoice slug is invalid.', $code, $caller, $previous),
|
||||
'SMS_CODE_CREATE_FAILED' => new self($rpc, 'An error occurred while creating the SMS code.', $code, $caller, $previous),
|
||||
'SMSJOB_ID_INVALID' => new self($rpc, 'The specified job ID is invalid.', $code, $caller, $previous),
|
||||
'SRP_ID_INVALID' => new self($rpc, 'Invalid SRP ID provided.', $code, $caller, $previous),
|
||||
'SRP_PASSWORD_CHANGED' => new self($rpc, 'Password has changed.', $code, $caller, $previous),
|
||||
'START_PARAM_EMPTY' => new self($rpc, 'The start parameter is empty.', $code, $caller, $previous),
|
||||
@ -604,6 +619,7 @@ class RPCErrorException extends \Exception
|
||||
'STORY_NOT_MODIFIED' => new self($rpc, 'The new story information you passed is equal to the previous story information, thus it wasn\'t modified.', $code, $caller, $previous),
|
||||
'STORY_PERIOD_INVALID' => new self($rpc, 'The specified story period is invalid for this account.', $code, $caller, $previous),
|
||||
'SWITCH_PM_TEXT_EMPTY' => new self($rpc, 'The switch_pm.text field was empty.', $code, $caller, $previous),
|
||||
'SWITCH_WEBVIEW_URL_INVALID' => new self($rpc, 'The URL specified in switch_webview.url is invalid!', $code, $caller, $previous),
|
||||
'TAKEOUT_INVALID' => new self($rpc, 'The specified takeout ID is invalid.', $code, $caller, $previous),
|
||||
'TAKEOUT_REQUIRED' => new self($rpc, 'A [takeout](https://core.telegram.org/api/takeout) session needs to be initialized first, [see here » for more info](/api/takeout).', $code, $caller, $previous),
|
||||
'TASK_ALREADY_EXISTS' => new self($rpc, 'An email reset was already requested.', $code, $caller, $previous),
|
||||
@ -629,6 +645,7 @@ class RPCErrorException extends \Exception
|
||||
'TOPIC_TITLE_EMPTY' => new self($rpc, 'The specified topic title is empty.', $code, $caller, $previous),
|
||||
'TOPICS_EMPTY' => new self($rpc, 'You specified no topic IDs.', $code, $caller, $previous),
|
||||
'TRANSCRIPTION_FAILED' => new self($rpc, 'Audio transcription failed.', $code, $caller, $previous),
|
||||
'TRANSLATE_REQ_QUOTA_EXCEEDED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'TTL_DAYS_INVALID' => new self($rpc, 'The provided TTL is invalid.', $code, $caller, $previous),
|
||||
'TTL_MEDIA_INVALID' => new self($rpc, 'Invalid media Time To Live was provided.', $code, $caller, $previous),
|
||||
'TTL_PERIOD_INVALID' => new self($rpc, 'The specified TTL period is invalid.', $code, $caller, $previous),
|
||||
@ -667,6 +684,8 @@ class RPCErrorException extends \Exception
|
||||
'VENUE_ID_INVALID' => new self($rpc, 'The specified venue ID is invalid.', $code, $caller, $previous),
|
||||
'VIDEO_CONTENT_TYPE_INVALID' => new self($rpc, 'The video\'s content type is invalid.', $code, $caller, $previous),
|
||||
'VIDEO_FILE_INVALID' => new self($rpc, 'The specified video file is invalid.', $code, $caller, $previous),
|
||||
'VIDEO_PAUSE_FORBIDDEN' => new self($rpc, 'You cannot pause the video stream.', $code, $caller, $previous),
|
||||
'VIDEO_STOP_FORBIDDEN' => new self($rpc, 'You cannot stop the video stream.', $code, $caller, $previous),
|
||||
'VIDEO_TITLE_EMPTY' => new self($rpc, 'The specified video title is empty.', $code, $caller, $previous),
|
||||
'VOICE_MESSAGES_FORBIDDEN' => new \danog\MadelineProto\RPCError\VoiceMessagesForbiddenError($code, $caller, $previous),
|
||||
'WALLPAPER_FILE_INVALID' => new self($rpc, 'The specified wallpaper file is invalid.', $code, $caller, $previous),
|
||||
@ -686,6 +705,34 @@ class RPCErrorException extends \Exception
|
||||
'WEBPUSH_KEY_INVALID' => new self($rpc, 'The specified web push elliptic curve Diffie-Hellman public key is invalid.', $code, $caller, $previous),
|
||||
'WEBPUSH_TOKEN_INVALID' => new self($rpc, 'The specified web push token is invalid.', $code, $caller, $previous),
|
||||
'YOU_BLOCKED_USER' => new \danog\MadelineProto\RPCError\YouBlockedUserError($code, $caller, $previous),
|
||||
'BASE_PORT_LOC_INVALID' => new self($rpc, '', $code, $caller, $previous),
|
||||
'BOT_GAMES_DISABLED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'BOT_METHOD_INVALID' => new self($rpc, 'The specified method cannot be used by bots.', $code, $caller, $previous),
|
||||
'BOT_POLLS_DISABLED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'CHANNEL_ADD_INVALID' => new self($rpc, '', $code, $caller, $previous),
|
||||
'CHANNEL_BANNED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'CONNECTION_DEVICE_MODEL_EMPTY' => new self($rpc, 'The specified device model is empty.', $code, $caller, $previous),
|
||||
'CONNECTION_LANG_PACK_INVALID' => new self($rpc, 'The specified language pack is empty.', $code, $caller, $previous),
|
||||
'CONNECTION_NOT_INITED' => new self($rpc, 'Please initialize the connection using initConnection before making queries.', $code, $caller, $previous),
|
||||
'CONNECTION_SYSTEM_EMPTY' => new self($rpc, 'The specified system version is empty.', $code, $caller, $previous),
|
||||
'CONNECTION_SYSTEM_LANG_CODE_EMPTY' => new self($rpc, 'The specified system language code is empty.', $code, $caller, $previous),
|
||||
'FIELD_NAME_EMPTY' => new self($rpc, '', $code, $caller, $previous),
|
||||
'FIELD_NAME_INVALID' => new self($rpc, '', $code, $caller, $previous),
|
||||
'GROUP_CALL_INVALID' => new self($rpc, '', $code, $caller, $previous),
|
||||
'INPUT_CONSTRUCTOR_INVALID' => new self($rpc, 'The specified TL constructor is invalid.', $code, $caller, $previous),
|
||||
'INPUT_FETCH_ERROR' => new self($rpc, 'An error occurred while parsing the provided TL constructor.', $code, $caller, $previous),
|
||||
'INPUT_FETCH_FAIL' => new self($rpc, 'An error occurred while parsing the provided TL constructor.', $code, $caller, $previous),
|
||||
'INPUT_LAYER_INVALID' => new self($rpc, 'The specified layer is invalid.', $code, $caller, $previous),
|
||||
'INPUT_METHOD_INVALID' => new self($rpc, 'The specified method is invalid.', $code, $caller, $previous),
|
||||
'INPUT_REQUEST_TOO_LONG' => new self($rpc, 'The request payload is too long.', $code, $caller, $previous),
|
||||
'PEER_FLOOD' => new self($rpc, 'The current account is spamreported, you cannot execute this action, check @spambot for more info.', $code, $caller, $previous),
|
||||
'PHOTO_THUMB_URL_INVALID' => new self($rpc, '', $code, $caller, $previous),
|
||||
'REFLECTOR_NOT_AVAILABLE' => new self($rpc, '', $code, $caller, $previous),
|
||||
'SHORTNAME_OCCUPY_FAILED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'STICKERSET_NOT_MODIFIED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'TMP_PASSWORD_INVALID' => new self($rpc, '', $code, $caller, $previous),
|
||||
'TYPE_CONSTRUCTOR_INVALID' => new self($rpc, '', $code, $caller, $previous),
|
||||
'WEBDOCUMENT_URL_EMPTY' => new self($rpc, '', $code, $caller, $previous),
|
||||
'ANONYMOUS_REACTIONS_DISABLED' => new self($rpc, 'Sorry, anonymous administrators cannot leave reactions or participate in polls.', $code, $caller, $previous),
|
||||
'BROADCAST_FORBIDDEN' => new self($rpc, 'Channel poll voters and reactions cannot be fetched to prevent deanonymization.', $code, $caller, $previous),
|
||||
'CHANNEL_PUBLIC_GROUP_NA' => new self($rpc, 'channel/supergroup not available.', $code, $caller, $previous),
|
||||
@ -699,6 +746,7 @@ class RPCErrorException extends \Exception
|
||||
'CHAT_SEND_PHOTOS_FORBIDDEN' => new \danog\MadelineProto\RPCError\ChatSendPhotosForbiddenError($code, $caller, $previous),
|
||||
'CHAT_SEND_PLAIN_FORBIDDEN' => new \danog\MadelineProto\RPCError\ChatSendPlainForbiddenError($code, $caller, $previous),
|
||||
'CHAT_SEND_POLL_FORBIDDEN' => new \danog\MadelineProto\RPCError\ChatSendPollForbiddenError($code, $caller, $previous),
|
||||
'CHAT_SEND_ROUNDVIDEOS_FORBIDDEN' => new \danog\MadelineProto\RPCError\ChatSendRoundvideosForbiddenError($code, $caller, $previous),
|
||||
'CHAT_SEND_STICKERS_FORBIDDEN' => new \danog\MadelineProto\RPCError\ChatSendStickersForbiddenError($code, $caller, $previous),
|
||||
'CHAT_SEND_VIDEOS_FORBIDDEN' => new \danog\MadelineProto\RPCError\ChatSendVideosForbiddenError($code, $caller, $previous),
|
||||
'CHAT_SEND_VOICES_FORBIDDEN' => new \danog\MadelineProto\RPCError\ChatSendVoicesForbiddenError($code, $caller, $previous),
|
||||
@ -716,6 +764,7 @@ class RPCErrorException extends \Exception
|
||||
'USER_DELETED' => new self($rpc, 'You can\'t send this secret message because the other participant deleted their account.', $code, $caller, $previous),
|
||||
'USER_PRIVACY_RESTRICTED' => new self($rpc, 'The user\'s privacy settings do not allow you to do this.', $code, $caller, $previous),
|
||||
'USER_RESTRICTED' => new self($rpc, 'You\'re spamreported, you can\'t create channels or chats.', $code, $caller, $previous),
|
||||
'CHAT_FORBIDDEN' => new \danog\MadelineProto\RPCError\ChatForbiddenError($code, $caller, $previous),
|
||||
'CALL_PROTOCOL_COMPAT_LAYER_INVALID' => new self($rpc, 'The other side of the call does not support any of the VoIP protocols supported by the local client, as specified by the `protocol.layer` and `protocol.library_versions` fields.', $code, $caller, $previous),
|
||||
'FILEREF_UPGRADE_NEEDED' => new self($rpc, 'The client has to be updated in order to support [file references](https://core.telegram.org/api/file_reference).', $code, $caller, $previous),
|
||||
'FRESH_CHANGE_PHONE_FORBIDDEN' => new self($rpc, 'You can\'t change phone number right after logging in, please wait at least 24 hours.', $code, $caller, $previous),
|
||||
@ -726,6 +775,16 @@ class RPCErrorException extends \Exception
|
||||
'STICKERSET_OWNER_ANONYMOUS' => new self($rpc, 'Provided stickerset can\'t be installed as group stickerset to prevent admin deanonymization.', $code, $caller, $previous),
|
||||
'UPDATE_APP_TO_LOGIN' => new self($rpc, 'Please update to the latest version of MadelineProto to login.', $code, $caller, $previous),
|
||||
'USERPIC_PRIVACY_REQUIRED' => new self($rpc, 'You need to disable privacy settings for your profile picture in order to make your geolocation public.', $code, $caller, $previous),
|
||||
'AUTH_KEY_DUPLICATED' => new self($rpc, 'Concurrent usage of the current session from multiple connections was detected, the current session was invalidated by the server for security reasons!', $code, $caller, $previous),
|
||||
'ACTIVE_USER_REQUIRED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'AUTH_KEY_INVALID' => new self($rpc, '', $code, $caller, $previous),
|
||||
'AUTH_KEY_PERM_EMPTY' => new self($rpc, '', $code, $caller, $previous),
|
||||
'AUTH_KEY_UNREGISTERED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'SESSION_EXPIRED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'SESSION_PASSWORD_NEEDED' => new \danog\MadelineProto\RPCError\SessionPasswordNeededError($code, $caller, $previous),
|
||||
'SESSION_REVOKED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'USER_DEACTIVATED' => new self($rpc, '', $code, $caller, $previous),
|
||||
'USER_DEACTIVATED_BAN' => new self($rpc, '', $code, $caller, $previous),
|
||||
default => new self($rpc, self::report($rpc, $code, $caller), $code, $caller, $previous)
|
||||
};
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -77,6 +77,9 @@ $whitelist = [
|
||||
UserIsBlockedError::class => true,
|
||||
UserIsBotError::class => true,
|
||||
FileTokenInvalidError::class => true,
|
||||
\danog\MadelineProto\RPCError\SessionPasswordNeededError::class => true,
|
||||
\danog\MadelineProto\RPCError\ChannelPrivateError::class => true,
|
||||
\danog\MadelineProto\RPCError\ChatForbiddenError::class => true,
|
||||
];
|
||||
|
||||
$whitelistMethods = [
|
||||
@ -171,8 +174,6 @@ file_put_contents('src/RPCErrorException.php', $err);
|
||||
|
||||
require 'tools/translator.php';
|
||||
|
||||
copy('https://rpc.madelineproto.xyz/v3.json', 'src/v3.json');
|
||||
|
||||
Magic::start(light: false);
|
||||
Logger::constructorFromSettings(new SettingsLogger);
|
||||
$logger = Logger::$default;
|
||||
|
Loading…
Reference in New Issue
Block a user