o
    Zzj®  ã                   @   sl   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZmZ er,ddlmZ G dd	„ d	eƒZd
S )z;This module contains an object related to a Telegram Story.é    )ÚTYPE_CHECKING)ÚChat)ÚTelegramObject)ÚDEFAULT_NONE)ÚJSONDictÚODVInputÚ
TimePeriod)ÚBotc                       sÂ   e Zd ZdZdZddœdedededB ddf‡ fd	d
„Ze	ddedddd f‡ fdd„ƒZ
defeeeeddœdedededB dee dee dee dee dee dedB dd fdd„Z‡  ZS )ÚStorya‡  
    This object represents a story.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`chat` and :attr:`id` are equal.

    .. versionadded:: 20.5

    .. versionchanged:: 21.0
        Added attributes :attr:`chat` and :attr:`id` and equality based on them.

    Args:
        chat (:class:`telegram.Chat`): Chat that posted the story.
        id (:obj:`int`): Unique identifier for the story in the chat.

    Attributes:
        chat (:class:`telegram.Chat`): Chat that posted the story.
        id (:obj:`int`): Unique identifier for the story in the chat.

    )ÚchatÚidN©Ú
api_kwargsr   r   r   Úreturnc                   s4   t ƒ j|d� || _|| _| j| jf| _|  ¡  d S )Nr   )ÚsuperÚ__init__r   r   Ú	_id_attrsÚ_freeze)Úselfr   r   r   ©Ú	__class__© úJ/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telegram/_story.pyr   ;   s
   zStory.__init__ÚdataÚbotz
Bot | Nonec                    s2   |   |¡}t | di ¡|¡|d< tƒ j||d�S )z,See :meth:`telegram.TelegramObject.de_json`.r   )r   r   )Ú_parse_datar   Úde_jsonÚgetr   )Úclsr   r   r   r   r   r   J   s   
zStory.de_json)Úread_timeoutÚwrite_timeoutÚconnect_timeoutÚpool_timeoutr   Úbusiness_connection_idÚactive_periodÚpost_to_chat_pageÚprotect_contentr   r    r!   r"   c          
      Ã   s2   �|   ¡ j|| jj| j||||||||	d�I dH S )a•  Shortcut for::

             await bot.repost_story(
                from_chat_id=story.chat.id,
                from_story_id=story.id,
                *args, **kwargs
            )

        For the documentation of the arguments, please see :meth:`telegram.Bot.repost_story`.

        .. versionadded:: 22.6

        Returns:
            :class:`Story`: On success, :class:`Story` is returned.

        )r#   Úfrom_chat_idÚfrom_story_idr$   r%   r&   r   r    r!   r"   r   N)Úget_botÚrepost_storyr   r   )
r   r#   r$   r%   r&   r   r    r!   r"   r   r   r   r   ÚrepostR   s   €õzStory.repost)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   Úintr   r   Úclassmethodr   r   Ústrr   Úboolr   Úfloatr+   Ú__classcell__r   r   r   r   r
       sX    
ûþýûúûõþýüûùø	÷
öõôr
   N)r/   Útypingr   Útelegram._chatr   Útelegram._telegramobjectr   Útelegram._utils.defaultvaluer   Útelegram._utils.typesr   r   r   Útelegramr	   r
   r   r   r   r   Ú<module>   s   