Document more RPC errors

These two occur when replying to an inline query with a photo and
InputBotInlineMessageMediaAuto empty message, and passing URLs to
PNGs that may not be accessible (i.e. 403 from pixiv).
This commit is contained in:
Lonami Exo 2019-01-17 16:51:50 +01:00
parent 09e58c4e53
commit b0883148f5
3 changed files with 13 additions and 1 deletions

View File

@ -26,6 +26,16 @@ class DownloadMethods(UserMethods):
entity (`entity`):
From who the photo will be downloaded.
.. note::
This method expects the full entity (which has the data
to download the photo), not an input variant.
It's possible that sometimes you can't fetch the entity
from its input (since you can get errors like
``ChannelPrivateError``) but you already have it through
another call, like getting a forwarded message from it.
file (`str` | `file`, optional):
The output file path, directory, or stream-like object.
If the path exists and is a file, it will be overwritten.

View File

@ -166,11 +166,13 @@ PHONE_NUMBER_OCCUPIED,400,The phone number is already in use
PHONE_NUMBER_UNOCCUPIED,400,The phone number is not yet being used
PHONE_PASSWORD_FLOOD,406,You have tried logging in too many times
PHONE_PASSWORD_PROTECTED,400,This phone is password protected
PHOTO_CONTENT_URL_EMPTY,400,The content from the URL used as a photo appears to be empty or has caused another HTTP error
PHOTO_CROP_SIZE_SMALL,400,Photo is too small
PHOTO_EXT_INVALID,400,The extension of the photo is invalid
PHOTO_INVALID,400,Photo invalid
PHOTO_INVALID_DIMENSIONS,400,The photo dimensions are invalid
PHOTO_SAVE_FILE_INVALID,400,The photo you tried to send cannot be saved by Telegram. A reason may be that it exceeds 10MB. Try resizing it locally
PHOTO_THUMB_URL_EMPTY,400,The URL used as a thumbnail appears to be empty or has caused another HTTP error
PIN_RESTRICTED,400,You can't pin messages in private chats with other people
PRIVACY_KEY_INVALID,400,The privacy key is invalid
PTS_CHANGE_EMPTY,500,No PTS change

1 name codes description
166 PHONE_NUMBER_UNOCCUPIED 400 The phone number is not yet being used
167 PHONE_PASSWORD_FLOOD 406 You have tried logging in too many times
168 PHONE_PASSWORD_PROTECTED 400 This phone is password protected
169 PHOTO_CONTENT_URL_EMPTY 400 The content from the URL used as a photo appears to be empty or has caused another HTTP error
170 PHOTO_CROP_SIZE_SMALL 400 Photo is too small
171 PHOTO_EXT_INVALID 400 The extension of the photo is invalid
172 PHOTO_INVALID 400 Photo invalid
173 PHOTO_INVALID_DIMENSIONS 400 The photo dimensions are invalid
174 PHOTO_SAVE_FILE_INVALID 400 The photo you tried to send cannot be saved by Telegram. A reason may be that it exceeds 10MB. Try resizing it locally
175 PHOTO_THUMB_URL_EMPTY 400 The URL used as a thumbnail appears to be empty or has caused another HTTP error
176 PIN_RESTRICTED 400 You can't pin messages in private chats with other people
177 PRIVACY_KEY_INVALID 400 The privacy key is invalid
178 PTS_CHANGE_EMPTY 500 No PTS change

View File

@ -147,7 +147,7 @@ messages.setBotPrecheckoutResults,unknown,ERROR_TEXT_EMPTY
messages.setBotShippingResults,unknown,QUERY_ID_INVALID
messages.setEncryptedTyping,user,CHAT_ID_INVALID
messages.setGameScore,unknown,PEER_ID_INVALID USER_BOT_REQUIRED
messages.setInlineBotResults,unknown,ARTICLE_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID MESSAGE_EMPTY QUERY_ID_INVALID REPLY_MARKUP_INVALID RESULT_TYPE_INVALID SEND_MESSAGE_MEDIA_INVALID SEND_MESSAGE_TYPE_INVALID START_PARAM_INVALID USER_BOT_INVALID
messages.setInlineBotResults,unknown,ARTICLE_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID MESSAGE_EMPTY PHOTO_CONTENT_URL_EMPTY PHOTO_THUMB_URL_EMPTY QUERY_ID_INVALID REPLY_MARKUP_INVALID RESULT_TYPE_INVALID SEND_MESSAGE_MEDIA_INVALID SEND_MESSAGE_TYPE_INVALID START_PARAM_INVALID USER_BOT_INVALID
messages.setInlineGameScore,unknown,MESSAGE_ID_INVALID USER_BOT_REQUIRED
messages.setTyping,unknown,CHANNEL_INVALID CHANNEL_PRIVATE CHAT_ID_INVALID CHAT_WRITE_FORBIDDEN PEER_ID_INVALID USER_BANNED_IN_CHANNEL USER_IS_BLOCKED USER_IS_BOT
messages.startBot,user,BOT_INVALID PEER_ID_INVALID START_PARAM_EMPTY START_PARAM_INVALID

1 method usability errors
147 messages.setBotShippingResults unknown QUERY_ID_INVALID
148 messages.setEncryptedTyping user CHAT_ID_INVALID
149 messages.setGameScore unknown PEER_ID_INVALID USER_BOT_REQUIRED
150 messages.setInlineBotResults unknown ARTICLE_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID MESSAGE_EMPTY QUERY_ID_INVALID REPLY_MARKUP_INVALID RESULT_TYPE_INVALID SEND_MESSAGE_MEDIA_INVALID SEND_MESSAGE_TYPE_INVALID START_PARAM_INVALID USER_BOT_INVALID ARTICLE_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID MESSAGE_EMPTY PHOTO_CONTENT_URL_EMPTY PHOTO_THUMB_URL_EMPTY QUERY_ID_INVALID REPLY_MARKUP_INVALID RESULT_TYPE_INVALID SEND_MESSAGE_MEDIA_INVALID SEND_MESSAGE_TYPE_INVALID START_PARAM_INVALID USER_BOT_INVALID
151 messages.setInlineGameScore unknown MESSAGE_ID_INVALID USER_BOT_REQUIRED
152 messages.setTyping unknown CHANNEL_INVALID CHANNEL_PRIVATE CHAT_ID_INVALID CHAT_WRITE_FORBIDDEN PEER_ID_INVALID USER_BANNED_IN_CHANNEL USER_IS_BLOCKED USER_IS_BOT
153 messages.startBot user BOT_INVALID PEER_ID_INVALID START_PARAM_EMPTY START_PARAM_INVALID