U
    ‰¾úgä
  ã                   @   sJ   d Z ddlmZ ddlmZ ddlmZmZ G dd„ deeeef ƒZdS )z1This module contains the PollAnswerHandler class.é    )ÚUpdate)ÚBaseHandler)ÚCCTÚRTc                   @   s$   e Zd ZdZdZeedœdd„ZdS )ÚPollAnswerHandlera3  Handler class to handle Telegram updates that contain a
    :attr:`poll answer <telegram.Update.poll_answer>`.

    Warning:
        When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
        attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.

    Examples:
        :any:`Poll Bot <examples.pollbot>`

    Args:
        callback (:term:`coroutine function`): The callback function for this handler. Will be
            called when :meth:`check_update` has determined that an update should be processed by
            this handler. Callback signature::

                async def callback(update: Update, context: CallbackContext)

            The return value of the callback is usually ignored except for the special case of
            :class:`telegram.ext.ConversationHandler`.
        block (:obj:`bool`, optional): Determines whether the return value of the callback should
            be awaited before processing the next handler in
            :meth:`telegram.ext.Application.process_update`. Defaults to :obj:`True`.

            .. seealso:: :wiki:`Concurrency`

    Attributes:
        callback (:term:`coroutine function`): The callback function for this handler.
        block (:obj:`bool`): Determines whether the callback will run in a blocking way..

    © )ÚupdateÚreturnc                 C   s   t |tƒot|jƒS )zäDetermines whether an update should be passed to this handler's :attr:`callback`.

        Args:
            update (:class:`telegram.Update` | :obj:`object`): Incoming update.

        Returns:
            :obj:`bool`

        )Ú
isinstancer   ÚboolZpoll_answer)Úselfr   r   r   úL/tmp/pip-unpacked-wheel-swnnwir2/telegram/ext/_handlers/pollanswerhandler.pyÚcheck_update=   s    
zPollAnswerHandler.check_updateN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Úobjectr   r   r   r   r   r   r      s   r   N)	r   Ztelegramr   Z"telegram.ext._handlers.basehandlerr   Ztelegram.ext._utils.typesr   r   r   r   r   r   r   Ú<module>   s   