mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-01-24 16:24:15 +03:00
parent
dd00829f1e
commit
4b6c69ac1e
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
|
@ -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
|
||||
|
|
|
Loading…
Reference in New Issue
Block a user