示例#1
0
    def __init__(self, dialog_id: str,
                 validator: Callable[[PromptValidatorContext], bool]):
        """
        Initializes a new instance of the :class:`ActivityPrompt` class.

        :param dialog_id: Unique ID of the dialog within its parent :class:`DialogSet` or :class:`ComponentDialog`.
        :type dialog_id: str
        :param validator: Validator that will be called each time a new activity is received.
        :type validator: :class:`typing.Callable[[:class:`PromptValidatorContext`], bool]`
        """
        Dialog.__init__(self, dialog_id)

        if validator is None:
            raise TypeError("validator was expected but received None")
        self._validator = validator
    def __init__(self, dialog_id: str,
                 validator: Callable[[PromptValidatorContext], bool]):
        """
        Initializes a new instance of the ActivityPrompt class.

        Parameters:
        ----------
        dialog_id (str): Unique ID of the dialog within its parent DialogSet or ComponentDialog.

        validator: Validator that will be called each time a new activity is received.
        """
        Dialog.__init__(self, dialog_id)

        if validator is None:
            raise TypeError('validator was expected but received None')
        self._validator = validator
示例#3
0
 def __init__(self, storage: Storage, settings: BotFrameworkAdapterSettings,
              loop):
     super(ActivityHandler, self).__init__(storage, settings, Dialog(),
                                           loop)