Update docs and list of errors

Includes the changes of #1654.
This commit is contained in:
Lonami Exo 2020-12-19 20:33:20 +01:00
parent dd00829f1e
commit 4b6c69ac1e
3 changed files with 7 additions and 5 deletions

View File

@ -88,7 +88,7 @@ Next, we will see some examples from the most popular libraries.
Migrating from python-telegram-bot
----------------------------------
Let's take their `echobot2.py`_ example and shorten it a bit:
Let's take their `echobot.py`_ example and shorten it a bit:
.. code-block:: python
@ -107,7 +107,7 @@ Let's take their `echobot2.py`_ example and shorten it a bit:
updater = Updater("TOKEN")
dp = updater.dispatcher
dp.add_handler(CommandHandler("start", start))
dp.add_handler(MessageHandler(Filters.text, echo))
dp.add_handler(MessageHandler(Filters.text & ~Filters.command, echo))
updater.start_polling()
@ -330,4 +330,4 @@ Key differences:
.. _aiohttp: https://docs.aiohttp.org/en/stable
.. _aiogram: https://aiogram.readthedocs.io
.. _dumbot: https://github.com/Lonami/dumbot
.. _echobot2.py: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot2.py
.. _echobot.py: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot.py

View File

@ -74,6 +74,7 @@ CHAT_SEND_MEDIA_FORBIDDEN,403,You can't send media in this chat
CHAT_SEND_STICKERS_FORBIDDEN,403,You can't send stickers in this chat
CHAT_TITLE_EMPTY,400,No chat title provided
CHAT_WRITE_FORBIDDEN,403,You can't write in this chat
CHP_CALL_FAIL,500,The statistics cannot be retrieved at this time
CODE_EMPTY,400,The provided code is empty
CODE_HASH_INVALID,400,Code hash invalid
CODE_INVALID,400,Code invalid (i.e. from email)
@ -194,6 +195,7 @@ NEED_MEMBER_INVALID,500,The provided member is invalid or does not exist (for ex
NETWORK_MIGRATE_X,303,The source IP address is associated with DC {new_dc}
NEW_SALT_INVALID,400,The new salt is invalid
NEW_SETTINGS_INVALID,400,The new settings are invalid
NEXT_OFFSET_INVALID,400,The value for next_offset is invalid. Check that it has normal characters and is not too long
OFFSET_INVALID,400,"The given offset was invalid, it must be divisible by 1KB. See https://core.telegram.org/api/files#downloading-files"
OFFSET_PEER_ID_INVALID,400,The provided offset peer is invalid
OPTIONS_TOO_MUCH,400,You defined too many options for the poll

1 name codes description
74 CHAT_SEND_STICKERS_FORBIDDEN 403 You can't send stickers in this chat
75 CHAT_TITLE_EMPTY 400 No chat title provided
76 CHAT_WRITE_FORBIDDEN 403 You can't write in this chat
77 CHP_CALL_FAIL 500 The statistics cannot be retrieved at this time
78 CODE_EMPTY 400 The provided code is empty
79 CODE_HASH_INVALID 400 Code hash invalid
80 CODE_INVALID 400 Code invalid (i.e. from email)
195 NETWORK_MIGRATE_X 303 The source IP address is associated with DC {new_dc}
196 NEW_SALT_INVALID 400 The new salt is invalid
197 NEW_SETTINGS_INVALID 400 The new settings are invalid
198 NEXT_OFFSET_INVALID 400 The value for next_offset is invalid. Check that it has normal characters and is not too long
199 OFFSET_INVALID 400 The given offset was invalid, it must be divisible by 1KB. See https://core.telegram.org/api/files#downloading-files
200 OFFSET_PEER_ID_INVALID 400 The provided offset peer is invalid
201 OPTIONS_TOO_MUCH 400 You defined too many options for the poll

View File

@ -284,7 +284,7 @@ messages.setBotPrecheckoutResults,both,ERROR_TEXT_EMPTY
messages.setBotShippingResults,both,QUERY_ID_INVALID
messages.setEncryptedTyping,user,CHAT_ID_INVALID
messages.setGameScore,bot,PEER_ID_INVALID USER_BOT_REQUIRED
messages.setInlineBotResults,bot,ARTICLE_TITLE_EMPTY AUDIO_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID DOCUMENT_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 STICKER_DOCUMENT_INVALID USER_BOT_INVALID WEBDOCUMENT_URL_INVALID
messages.setInlineBotResults,bot,ARTICLE_TITLE_EMPTY AUDIO_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID DOCUMENT_INVALID MESSAGE_EMPTY NEXT_OFFSET_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_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
@ -321,7 +321,7 @@ reqPq,both,
reqPqMulti,both,
rpcDropAnswer,both,
setClientDHParams,both,
stats.getBroadcastStats,user,BROADCAST_REQUIRED CHAT_ADMIN_REQUIRED STATS_MIGRATE_X
stats.getBroadcastStats,user,BROADCAST_REQUIRED CHAT_ADMIN_REQUIRED CHP_CALL_FAIL STATS_MIGRATE_X
stats.getMegagroupStats,user,CHAT_ADMIN_REQUIRED MEGAGROUP_REQUIRED STATS_MIGRATE_X
stats.loadAsyncGraph,user,GRAPH_OUTDATED_RELOAD
stickers.addStickerToSet,bot,BOT_MISSING STICKERSET_INVALID

1 method usability errors
284 messages.setBotShippingResults both QUERY_ID_INVALID
285 messages.setEncryptedTyping user CHAT_ID_INVALID
286 messages.setGameScore bot PEER_ID_INVALID USER_BOT_REQUIRED
287 messages.setInlineBotResults bot ARTICLE_TITLE_EMPTY AUDIO_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID DOCUMENT_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 STICKER_DOCUMENT_INVALID USER_BOT_INVALID WEBDOCUMENT_URL_INVALID ARTICLE_TITLE_EMPTY AUDIO_TITLE_EMPTY BUTTON_DATA_INVALID BUTTON_TYPE_INVALID BUTTON_URL_INVALID DOCUMENT_INVALID MESSAGE_EMPTY NEXT_OFFSET_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_URL_INVALID
288 messages.setInlineGameScore bot MESSAGE_ID_INVALID USER_BOT_REQUIRED
289 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
290 messages.startBot user BOT_INVALID PEER_ID_INVALID START_PARAM_EMPTY START_PARAM_INVALID
321 reqPqMulti both
322 rpcDropAnswer both
323 setClientDHParams both
324 stats.getBroadcastStats user BROADCAST_REQUIRED CHAT_ADMIN_REQUIRED STATS_MIGRATE_X BROADCAST_REQUIRED CHAT_ADMIN_REQUIRED CHP_CALL_FAIL STATS_MIGRATE_X
325 stats.getMegagroupStats user CHAT_ADMIN_REQUIRED MEGAGROUP_REQUIRED STATS_MIGRATE_X
326 stats.loadAsyncGraph user GRAPH_OUTDATED_RELOAD
327 stickers.addStickerToSet bot BOT_MISSING STICKERSET_INVALID