mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-21 21:39:46 +03:00
Update reaction example
This commit is contained in:
parent
10c46be72f
commit
a974bc8204
|
@ -49,13 +49,13 @@ It works very similar to replying to a message. You need to specify the chat,
|
||||||
message ID you wish to react to, and reaction, using :tl:`SendReaction`:
|
message ID you wish to react to, and reaction, using :tl:`SendReaction`:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
from telethon.tl import types
|
||||||
from telethon.tl.functions.messages import SendReactionRequest
|
from telethon.tl.functions.messages import SendReactionRequest
|
||||||
|
|
||||||
await client(SendReactionRequest(
|
await client(SendReactionRequest(
|
||||||
peer=chat,
|
peer=chat,
|
||||||
msg_id=42,
|
msg_id=42,
|
||||||
reaction='❤️'
|
reaction=types.ReactionEmoji('❤️')
|
||||||
))
|
))
|
||||||
|
|
||||||
Note that you cannot use strings like ``:heart:`` for the reaction. You must
|
Note that you cannot use strings like ``:heart:`` for the reaction. You must
|
||||||
|
@ -74,11 +74,12 @@ use its unicode escape (which you can find using websites like
|
||||||
reaction = '❤️'
|
reaction = '❤️'
|
||||||
reaction = '\u2764'
|
reaction = '\u2764'
|
||||||
|
|
||||||
|
from telethon.tl import types
|
||||||
from telethon.tl.functions.messages import SendReactionRequest
|
from telethon.tl.functions.messages import SendReactionRequest
|
||||||
await client(SendReactionRequest(
|
await client(SendReactionRequest(
|
||||||
peer=chat,
|
peer=chat,
|
||||||
msg_id=42,
|
msg_id=42,
|
||||||
reaction=reaction
|
reaction=types.ReactionEmoji(reaction)
|
||||||
))
|
))
|
||||||
|
|
||||||
Please make sure to check the help pages of the respective websites you use
|
Please make sure to check the help pages of the respective websites you use
|
||||||
|
|
Loading…
Reference in New Issue
Block a user