Skip to content

Commit e863b2a

Browse files
committed
Update RPC errors
1 parent 5412a7d commit e863b2a

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

‎src/RPCErrorException.php‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -860,27 +860,6 @@ public static function make(
860860
'INPUT_REQUEST_TOO_LONG' => new self($rpc, 'The request payload is too long.', $code, $caller, $previous),
861861
'PEER_FLOOD' => new self($rpc, 'The current account is spamreported, you cannot execute this action, check @spambot for more info.', $code, $caller, $previous),
862862
'STICKERSET_NOT_MODIFIED' => new self($rpc, 'The passed stickerset information is equal to the current information.', $code, $caller, $previous),
863-
'ALLOW_PAYMENT_REQUIRED' => new \danog\MadelineProto\RPCError\AllowPaymentRequiredError($code, $caller, $previous),
864-
'API_GIFT_RESTRICTED_UPDATE_APP' => new self($rpc, 'Please update the app to access the gift API.', $code, $caller, $previous),
865-
'BUSINESS_ADDRESS_ACTIVE' => new self($rpc, 'The user is currently advertising a [Business Location](https://core.telegram.org/api/business#location), the location may only be changed (or removed) using [account.updateBusinessLocation »](https://core.telegram.org/method/account.updateBusinessLocation). .', $code, $caller, $previous),
866-
'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),
867-
'FILEREF_UPGRADE_NEEDED' => new self($rpc, 'The client has to be updated in order to support [file references](https://core.telegram.org/api/file-references).', $code, $caller, $previous),
868-
'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),
869-
'FRESH_RESET_AUTHORISATION_FORBIDDEN' => new self($rpc, 'You can\'t logout other sessions if less than 24 hours have passed since you logged on the current session.', $code, $caller, $previous),
870-
'PAYMENT_UNSUPPORTED' => new \danog\MadelineProto\RPCError\PaymentUnsupportedError($code, $caller, $previous),
871-
'PHONE_PASSWORD_FLOOD' => new self($rpc, 'You have tried logging in too many times.', $code, $caller, $previous),
872-
'PRECHECKOUT_FAILED' => new self($rpc, 'Precheckout failed, a detailed and localized description for the error will be emitted via an [updateServiceNotification as specified here »](https://core.telegram.org/api/errors#406-not-acceptable).', $code, $caller, $previous),
873-
'PREMIUM_CURRENTLY_UNAVAILABLE' => new self($rpc, 'You cannot currently purchase a Premium subscription.', $code, $caller, $previous),
874-
'PRIVACY_PREMIUM_REQUIRED' => new \danog\MadelineProto\RPCError\PrivacyPremiumRequiredError($code, $caller, $previous),
875-
'SEND_CODE_UNAVAILABLE' => new self($rpc, 'Returned when all available options for this type of number were already used (e.g. flash-call, then SMS, then this error might be returned to trigger a second resend).', $code, $caller, $previous),
876-
'STARGIFT_EXPORT_IN_PROGRESS' => new self($rpc, 'A gift export is in progress, a detailed and localized description for the error will be emitted via an [updateServiceNotification as specified here »](https://core.telegram.org/api/errors#406-not-acceptable).', $code, $caller, $previous),
877-
'STARS_FORM_AMOUNT_MISMATCH' => new self($rpc, 'The form amount has changed, please fetch the new form using [payments.getPaymentForm](https://core.telegram.org/method/payments.getPaymentForm) and restart the process.', $code, $caller, $previous),
878-
'STICKERSET_OWNER_ANONYMOUS' => new self($rpc, 'Provided stickerset can\'t be installed as group stickerset to prevent admin deanonymization.', $code, $caller, $previous),
879-
'TRANSLATIONS_DISABLED' => new self($rpc, 'Translations are unavailable, a detailed and localized description for the error will be emitted via an [updateServiceNotification as specified here »](https://core.telegram.org/api/errors#406-not-acceptable).', $code, $caller, $previous),
880-
'UPDATE_APP_TO_LOGIN' => new self($rpc, 'Please update to the latest version of MadelineProto to login.', $code, $caller, $previous),
881-
'USER_RESTRICTED' => new self($rpc, 'You\'re spamreported, you can\'t create channels or chats.', $code, $caller, $previous),
882-
'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),
883-
'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),
884863
'ANONYMOUS_REACTIONS_DISABLED' => new self($rpc, 'Sorry, anonymous administrators cannot leave reactions or participate in polls.', $code, $caller, $previous),
885864
'BOT_ACCESS_FORBIDDEN' => new self($rpc, 'The specified method *can* be used over a [business connection](https://core.telegram.org/api/bots/connected-business-bots) for some operations, but the specified query attempted an operation that is not allowed over a business connection.', $code, $caller, $previous),
886865
'BOT_VERIFIER_FORBIDDEN' => new self($rpc, 'This bot cannot assign [verification icons](https://core.telegram.org/api/bots/verification).', $code, $caller, $previous),
@@ -910,14 +889,35 @@ public static function make(
910889
'MESSAGE_AUTHOR_REQUIRED' => new self($rpc, 'Message author required.', $code, $caller, $previous),
911890
'MESSAGE_DELETE_FORBIDDEN' => new self($rpc, 'You can\'t delete one of the messages you tried to delete, most likely because it is a service message.', $code, $caller, $previous),
912891
'POLL_VOTE_REQUIRED' => new self($rpc, 'Cast a vote in the poll before calling this method.', $code, $caller, $previous),
892+
'PRIVACY_PREMIUM_REQUIRED' => new \danog\MadelineProto\RPCError\PrivacyPremiumRequiredError($code, $caller, $previous),
913893
'PUBLIC_CHANNEL_MISSING' => new self($rpc, 'You can only export group call invite links for public chats or channels.', $code, $caller, $previous),
914894
'RIGHT_FORBIDDEN' => new self($rpc, 'Your admin rights do not allow you to do this.', $code, $caller, $previous),
915895
'SENSITIVE_CHANGE_FORBIDDEN' => new self($rpc, 'You can\'t change your sensitive content settings.', $code, $caller, $previous),
916896
'USER_DELETED' => new self($rpc, 'You can\'t send this secret message because the other participant deleted their account.', $code, $caller, $previous),
917897
'USER_PERMISSION_DENIED' => new self($rpc, 'The user hasn\'t granted or has revoked the bot\'s access to change their emoji status using [bots.toggleUserEmojiStatusPermission](https://core.telegram.org/method/bots.toggleUserEmojiStatusPermission).', $code, $caller, $previous),
918898
'USER_PRIVACY_RESTRICTED' => new self($rpc, 'The user\'s privacy settings do not allow you to do this.', $code, $caller, $previous),
899+
'USER_RESTRICTED' => new self($rpc, 'You\'re spamreported, you can\'t create channels or chats.', $code, $caller, $previous),
919900
'YOUR_PRIVACY_RESTRICTED' => new self($rpc, 'You cannot fetch the read date of this message because you have disallowed other users to do so for *your* messages; to fix, allow other users to see *your* exact last online date OR purchase a [Telegram Premium](https://core.telegram.org/api/premium) subscription.', $code, $caller, $previous),
920901
'CHAT_FORBIDDEN' => new \danog\MadelineProto\RPCError\ChatForbiddenError($code, $caller, $previous),
902+
'ALLOW_PAYMENT_REQUIRED' => new \danog\MadelineProto\RPCError\AllowPaymentRequiredError($code, $caller, $previous),
903+
'API_GIFT_RESTRICTED_UPDATE_APP' => new self($rpc, 'Please update the app to access the gift API.', $code, $caller, $previous),
904+
'BUSINESS_ADDRESS_ACTIVE' => new self($rpc, 'The user is currently advertising a [Business Location](https://core.telegram.org/api/business#location), the location may only be changed (or removed) using [account.updateBusinessLocation »](https://core.telegram.org/method/account.updateBusinessLocation). .', $code, $caller, $previous),
905+
'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),
906+
'FILEREF_UPGRADE_NEEDED' => new self($rpc, 'The client has to be updated in order to support [file references](https://core.telegram.org/api/file-references).', $code, $caller, $previous),
907+
'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),
908+
'FRESH_RESET_AUTHORISATION_FORBIDDEN' => new self($rpc, 'You can\'t logout other sessions if less than 24 hours have passed since you logged on the current session.', $code, $caller, $previous),
909+
'PAYMENT_UNSUPPORTED' => new \danog\MadelineProto\RPCError\PaymentUnsupportedError($code, $caller, $previous),
910+
'PHONE_PASSWORD_FLOOD' => new self($rpc, 'You have tried logging in too many times.', $code, $caller, $previous),
911+
'PRECHECKOUT_FAILED' => new self($rpc, 'Precheckout failed, a detailed and localized description for the error will be emitted via an [updateServiceNotification as specified here »](https://core.telegram.org/api/errors#406-not-acceptable).', $code, $caller, $previous),
912+
'PREMIUM_CURRENTLY_UNAVAILABLE' => new self($rpc, 'You cannot currently purchase a Premium subscription.', $code, $caller, $previous),
913+
'SEND_CODE_UNAVAILABLE' => new self($rpc, 'Returned when all available options for this type of number were already used (e.g. flash-call, then SMS, then this error might be returned to trigger a second resend).', $code, $caller, $previous),
914+
'STARGIFT_EXPORT_IN_PROGRESS' => new self($rpc, 'A gift export is in progress, a detailed and localized description for the error will be emitted via an [updateServiceNotification as specified here »](https://core.telegram.org/api/errors#406-not-acceptable).', $code, $caller, $previous),
915+
'STARS_FORM_AMOUNT_MISMATCH' => new self($rpc, 'The form amount has changed, please fetch the new form using [payments.getPaymentForm](https://core.telegram.org/method/payments.getPaymentForm) and restart the process.', $code, $caller, $previous),
916+
'STICKERSET_OWNER_ANONYMOUS' => new self($rpc, 'Provided stickerset can\'t be installed as group stickerset to prevent admin deanonymization.', $code, $caller, $previous),
917+
'TRANSLATIONS_DISABLED' => new self($rpc, 'Translations are unavailable, a detailed and localized description for the error will be emitted via an [updateServiceNotification as specified here »](https://core.telegram.org/api/errors#406-not-acceptable).', $code, $caller, $previous),
918+
'UPDATE_APP_TO_LOGIN' => new self($rpc, 'Please update to the latest version of MadelineProto to login.', $code, $caller, $previous),
919+
'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),
920+
'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),
921921
'AUTH_KEY_UNREGISTERED' => new self($rpc, 'The specified authorization key is not registered in the system (for example, a PFS temporary key has expired).', $code, $caller, $previous),
922922
'AUTH_KEY_INVALID' => new self($rpc, 'The specified auth key is invalid.', $code, $caller, $previous),
923923
'AUTH_KEY_PERM_EMPTY' => new self($rpc, 'The method is unavailable for temporary authorization keys, not bound to a permanent authorization key.', $code, $caller, $previous),

‎src/v3.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)