Fix inline force_document and new known RPC errors (#3084)

This should fix inline video notes.
This commit is contained in:
Devesh Pal 2021-06-24 17:49:01 +05:30 committed by GitHub
parent 417bfcd36e
commit 42bfc7bb3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -255,6 +255,8 @@ class InlineBuilder:
contact, file, geo, gif, photo, sticker, venue, video, voice.
It will be automatically set if ``mime_type`` is specified,
and default to ``'file'`` if no matching mime type is found.
you may need to pass ``attributes`` in order to use ``type``
effectively.
attributes (`list`, optional):
Optional attributes that override the inferred ones, like
@ -307,7 +309,7 @@ class InlineBuilder:
file,
mime_type=mime_type,
attributes=attributes,
force_document=True,
force_document=force_document,
voice_note=voice_note,
video_note=video_note,
allow_cache=use_cache

View File

@ -140,6 +140,7 @@ FRESH_CHANGE_PHONE_FORBIDDEN,406,Recently logged-in users cannot use this reques
FRESH_RESET_AUTHORISATION_FORBIDDEN,406,The current session is too new and cannot be used to reset other authorisations yet
FROM_PEER_INVALID,400,The given from_user peer cannot be used for the parameter
GAME_BOT_INVALID,400,You cannot send that game with the current bot
GIF_CONTENT_TYPE_INVALID,400,
GIF_ID_INVALID,400,The provided GIF ID is invalid
GRAPH_INVALID_RELOAD,400,
GRAPH_OUTDATED_RELOAD,400,"Data can't be used for the channel statistics, graphs outdated"
@ -346,6 +347,7 @@ TYPE_CONSTRUCTOR_INVALID,400,The type constructor is invalid
UNKNOWN_METHOD,500,The method you tried to call cannot be called on non-CDN DCs
UNTIL_DATE_INVALID,400,That date cannot be specified in this request (try using None)
URL_INVALID,400,The URL used was invalid (e.g. when answering a callback with a URL that's not t.me/yourbot or your game's URL)
USER_VOLUME_INVALID,400,
USERNAME_INVALID,400,"Nobody is using this username, or the username is unacceptable. If the latter, it must match r""[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]"""
USERNAME_NOT_MODIFIED,400,The username is not different from the current username
USERNAME_NOT_OCCUPIED,400,The username is not in use by anyone else yet
@ -376,6 +378,7 @@ USER_RESTRICTED,403,"You're spamreported, you can't create channels or chats."
USERPIC_UPLOAD_REQUIRED,400,You must have a profile picture before using this method
VIDEO_CONTENT_TYPE_INVALID,400,The video content type is not supported with the given parameters (i.e. supports_streaming)
VIDEO_FILE_INVALID,400,The given video cannot be used
VIDEO_TITLE_EMPTY,400,
WALLPAPER_FILE_INVALID,400,The given file cannot be used as a wallpaper
WALLPAPER_INVALID,400,The input wallpaper was not valid
WALLPAPER_MIME_INVALID,400,
@ -385,4 +388,4 @@ WEBDOCUMENT_URL_INVALID,400,The given URL cannot be used
WEBPAGE_CURL_FAILED,400,Failure while fetching the webpage with cURL
WEBPAGE_MEDIA_EMPTY,400,Webpage media empty
WORKER_BUSY_TOO_LONG_RETRY,500,Telegram workers are too busy to respond immediately
YOU_BLOCKED_USER,400,You blocked this user
YOU_BLOCKED_USER,400,You blocked this user
1 name codes description
140 FRESH_RESET_AUTHORISATION_FORBIDDEN 406 The current session is too new and cannot be used to reset other authorisations yet
141 FROM_PEER_INVALID 400 The given from_user peer cannot be used for the parameter
142 GAME_BOT_INVALID 400 You cannot send that game with the current bot
143 GIF_CONTENT_TYPE_INVALID 400
144 GIF_ID_INVALID 400 The provided GIF ID is invalid
145 GRAPH_INVALID_RELOAD 400
146 GRAPH_OUTDATED_RELOAD 400 Data can't be used for the channel statistics, graphs outdated
347 UNKNOWN_METHOD 500 The method you tried to call cannot be called on non-CDN DCs
348 UNTIL_DATE_INVALID 400 That date cannot be specified in this request (try using None)
349 URL_INVALID 400 The URL used was invalid (e.g. when answering a callback with a URL that's not t.me/yourbot or your game's URL)
350 USER_VOLUME_INVALID 400
351 USERNAME_INVALID 400 Nobody is using this username, or the username is unacceptable. If the latter, it must match r"[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]"
352 USERNAME_NOT_MODIFIED 400 The username is not different from the current username
353 USERNAME_NOT_OCCUPIED 400 The username is not in use by anyone else yet
378 USERPIC_UPLOAD_REQUIRED 400 You must have a profile picture before using this method
379 VIDEO_CONTENT_TYPE_INVALID 400 The video content type is not supported with the given parameters (i.e. supports_streaming)
380 VIDEO_FILE_INVALID 400 The given video cannot be used
381 VIDEO_TITLE_EMPTY 400
382 WALLPAPER_FILE_INVALID 400 The given file cannot be used as a wallpaper
383 WALLPAPER_INVALID 400 The input wallpaper was not valid
384 WALLPAPER_MIME_INVALID 400
388 WEBPAGE_CURL_FAILED 400 Failure while fetching the webpage with cURL
389 WEBPAGE_MEDIA_EMPTY 400 Webpage media empty
390 WORKER_BUSY_TOO_LONG_RETRY 500 Telegram workers are too busy to respond immediately
391 YOU_BLOCKED_USER 400 You blocked this user

View File

@ -286,7 +286,7 @@ messages.setBotShippingResults,both,QUERY_ID_INVALID
messages.setEncryptedTyping,user,CHAT_ID_INVALID
messages.setGameScore,bot,PEER_ID_INVALID USER_BOT_REQUIRED
messages.setHistoryTTL,user,CHAT_NOT_MODIFIED TTL_PERIOD_INVALID
messages.setInlineBotResults,bot,ARTICLE_TITLE_EMPTY AUDIO_CONTENT_URL_EMPTY AUDIO_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID DOCUMENT_INVALID MESSAGE_EMPTY NEXT_OFFSET_INVALID PHOTO_CONTENT_TYPE_INVALID 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 STICKER_DOCUMENT_INVALID USER_BOT_INVALID WEBDOCUMENT_MIME_INVALID WEBDOCUMENT_URL_INVALID
messages.setInlineBotResults,bot,ARTICLE_TITLE_EMPTY AUDIO_CONTENT_URL_EMPTY AUDIO_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID DOCUMENT_INVALID GIF_CONTENT_TYPE_INVALID MESSAGE_EMPTY NEXT_OFFSET_INVALID PHOTO_CONTENT_TYPE_INVALID 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 STICKER_DOCUMENT_INVALID USER_BOT_INVALID VIDEO_TITLE_EMPTY WEBDOCUMENT_MIME_INVALID WEBDOCUMENT_URL_INVALID
messages.setInlineGameScore,bot,MESSAGE_ID_INVALID USER_BOT_REQUIRED
messages.setTyping,both,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
@ -310,6 +310,7 @@ phone.acceptCall,user,CALL_ALREADY_ACCEPTED CALL_ALREADY_DECLINED CALL_OCCUPY_FA
phone.confirmCall,user,CALL_ALREADY_DECLINED CALL_PEER_INVALID
phone.createGroupCall,user,SCHEDULE_DATE_INVALID
phone.discardCall,user,CALL_ALREADY_ACCEPTED CALL_PEER_INVALID
phone.editGroupCallParticipant,user,USER_VOLUME_INVALID
phone.getCallConfig,user,
phone.inviteToGroupCall,user,GROUPCALL_FORBIDDEN
phone.joinGroupCall,user,GROUPCALL_SSRC_DUPLICATE_MUCH
@ -350,4 +351,4 @@ upload.saveBigFilePart,both,FILE_PARTS_INVALID FILE_PART_EMPTY FILE_PART_INVALID
upload.saveFilePart,both,FILE_PART_EMPTY FILE_PART_INVALID INPUT_FETCH_FAIL SESSION_PASSWORD_NEEDED
users.getFullUser,both,TIMEOUT USER_ID_INVALID
users.getUsers,both,AUTH_KEY_PERM_EMPTY MEMBER_NO_LOCATION NEED_MEMBER_INVALID SESSION_PASSWORD_NEEDED TIMEOUT
users.setSecureValueErrors,bot,
users.setSecureValueErrors,bot,
1 method usability errors
286 messages.setEncryptedTyping user CHAT_ID_INVALID
287 messages.setGameScore bot PEER_ID_INVALID USER_BOT_REQUIRED
288 messages.setHistoryTTL user CHAT_NOT_MODIFIED TTL_PERIOD_INVALID
289 messages.setInlineBotResults bot ARTICLE_TITLE_EMPTY AUDIO_CONTENT_URL_EMPTY AUDIO_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID DOCUMENT_INVALID MESSAGE_EMPTY NEXT_OFFSET_INVALID PHOTO_CONTENT_TYPE_INVALID 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 STICKER_DOCUMENT_INVALID USER_BOT_INVALID WEBDOCUMENT_MIME_INVALID WEBDOCUMENT_URL_INVALID ARTICLE_TITLE_EMPTY AUDIO_CONTENT_URL_EMPTY AUDIO_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID DOCUMENT_INVALID GIF_CONTENT_TYPE_INVALID MESSAGE_EMPTY NEXT_OFFSET_INVALID PHOTO_CONTENT_TYPE_INVALID 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 STICKER_DOCUMENT_INVALID USER_BOT_INVALID VIDEO_TITLE_EMPTY WEBDOCUMENT_MIME_INVALID WEBDOCUMENT_URL_INVALID
290 messages.setInlineGameScore bot MESSAGE_ID_INVALID USER_BOT_REQUIRED
291 messages.setTyping both CHANNEL_INVALID CHANNEL_PRIVATE CHAT_ID_INVALID CHAT_WRITE_FORBIDDEN PEER_ID_INVALID USER_BANNED_IN_CHANNEL USER_IS_BLOCKED USER_IS_BOT
292 messages.startBot user BOT_INVALID PEER_ID_INVALID START_PARAM_EMPTY START_PARAM_INVALID
310 phone.confirmCall user CALL_ALREADY_DECLINED CALL_PEER_INVALID
311 phone.createGroupCall user SCHEDULE_DATE_INVALID
312 phone.discardCall user CALL_ALREADY_ACCEPTED CALL_PEER_INVALID
313 phone.editGroupCallParticipant user USER_VOLUME_INVALID
314 phone.getCallConfig user
315 phone.inviteToGroupCall user GROUPCALL_FORBIDDEN
316 phone.joinGroupCall user GROUPCALL_SSRC_DUPLICATE_MUCH
351 upload.saveFilePart both FILE_PART_EMPTY FILE_PART_INVALID INPUT_FETCH_FAIL SESSION_PASSWORD_NEEDED
352 users.getFullUser both TIMEOUT USER_ID_INVALID
353 users.getUsers both AUTH_KEY_PERM_EMPTY MEMBER_NO_LOCATION NEED_MEMBER_INVALID SESSION_PASSWORD_NEEDED TIMEOUT
354 users.setSecureValueErrors bot