diff --git a/readthedocs/concepts/botapi-vs-mtproto.rst b/readthedocs/concepts/botapi-vs-mtproto.rst index 8c2f9479..cddb52d0 100644 --- a/readthedocs/concepts/botapi-vs-mtproto.rst +++ b/readthedocs/concepts/botapi-vs-mtproto.rst @@ -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 diff --git a/telethon_generator/data/errors.csv b/telethon_generator/data/errors.csv index 2fe17c4a..226e38dc 100644 --- a/telethon_generator/data/errors.csv +++ b/telethon_generator/data/errors.csv @@ -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 diff --git a/telethon_generator/data/methods.csv b/telethon_generator/data/methods.csv index f1114978..f5e287bf 100644 --- a/telethon_generator/data/methods.csv +++ b/telethon_generator/data/methods.csv @@ -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