mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2026-09-05 16:40:42 +00:00
Continue implementation
This commit is contained in:
@@ -318,7 +318,7 @@ In Telethon:
|
||||
.. code-block:: python
|
||||
|
||||
from telethon import Client, events
|
||||
from telethon.events.filters import Any, Command, TextOnly
|
||||
from telethon.events.filters import Any, Command, Media
|
||||
bot = Client('bot', api_id, api_hash)
|
||||
|
||||
# Handle '/start' and '/help'
|
||||
@@ -329,8 +329,8 @@ In Telethon:
|
||||
I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\
|
||||
""")
|
||||
|
||||
# Handle all other messages with only 'text'
|
||||
@bot.on(events.NewMessage, TextOnly())
|
||||
# Handle all other messages without media (negating the filter using ~)
|
||||
@bot.on(events.NewMessage, ~Media())
|
||||
async def echo_message(message: NewMessage):
|
||||
await message.reply(message.text)
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ Note that `CommonMark's markdown <https://commonmark.org/>`_ is not fully compat
|
||||
```
|
||||
|
||||
HTML is also not fully compatible with :term:`HTTP Bot API`'s
|
||||
`MarkdownV2 style <https://core.telegram.org/bots/api#markdownv2-style>`_,
|
||||
`HTML style <https://core.telegram.org/bots/api#html-style>`_,
|
||||
and instead favours more standard `HTML elements <https://developer.mozilla.org/en-US/docs/Web/HTML/Element>`_:
|
||||
|
||||
* ``strong`` and ``b`` for **bold**.
|
||||
|
||||
Reference in New Issue
Block a user