mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-12-18 07:14:27 +00:00
React bound method for story
This commit is contained in:
parent
35ebe8ea9d
commit
1c2747ff17
@ -1542,6 +1542,43 @@ class Story(Object, Update):
|
|||||||
|
|
||||||
return await self._client.export_story_link(chat_id=chat.id, story_id=self.id)
|
return await self._client.export_story_link(chat_id=chat.id, story_id=self.id)
|
||||||
|
|
||||||
|
async def react(self, emoji: Union[int, str] = None) -> bool:
|
||||||
|
"""Bound method *react* of :obj:`~pyrogram.types.Story`.
|
||||||
|
|
||||||
|
Use as a shortcut for:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
await client.send_reaction(
|
||||||
|
chat_id=chat_id,
|
||||||
|
story_id=story.id,
|
||||||
|
emoji="🔥"
|
||||||
|
)
|
||||||
|
|
||||||
|
Example:
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
await story.react(emoji="🔥")
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
emoji (``str``, *optional*):
|
||||||
|
Reaction emoji.
|
||||||
|
Pass "" as emoji (default) to retract the reaction.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
``bool``: On success, True is returned.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
"""
|
||||||
|
chat = self.from_user or self.sender_chat
|
||||||
|
|
||||||
|
return await self._client.send_reaction(
|
||||||
|
chat_id=chat.id,
|
||||||
|
story_id=self.id,
|
||||||
|
emoji=emoji
|
||||||
|
)
|
||||||
|
|
||||||
async def download(
|
async def download(
|
||||||
self,
|
self,
|
||||||
file_name: str = "",
|
file_name: str = "",
|
||||||
|
Loading…
Reference in New Issue
Block a user