Example #1
0
    def check_command(self):

        # If self.last_user_input equal to "echo 1" or "echo 3"
        if self.last_user_input in story_replies:

            if self.last_user_input == "echo 1":
                return True

            else:
                if self.echo_hit[self.last_user_input]:
                    self.echo_hit[self.last_user_input] = False
                    reply = pop_story(self.last_user_input)["clara"]
                    self.send_text("\n\n" + reply)

                    # Record that the user got optional info
                    # Replace spaces with underscores
                    user_input = "_".join(self.last_user_input.split(" "))
                    state_name = "clara_{}".format(user_input)
                    record_user_interaction(self, state_name)
                else:
                    self.send_text(
                        "\n{{rb:Questo l'hai giĆ  chiesto a Clara. "
                        "Domandale qualcos'altro.}}"
                    )

        else:
            return TerminalNanoBernard.check_command(self)
Example #2
0
    def check_command(self):

        # If self.last_user_input equal to "echo 1" or "echo 3"
        if self.last_user_input in story_replies:

            if self.last_user_input == "echo 1":
                return True

            else:
                if self.echo_hit[self.last_user_input]:
                    self.echo_hit[self.last_user_input] = False
                    reply = pop_story(self.last_user_input)["clara"]
                    self.send_text("\n\n" + reply)

                    # Record that the user got optional info
                    # Replace spaces with underscores
                    user_input = "_".join(self.last_user_input.split(" "))
                    state_name = "clara_%s" % user_input
                    record_user_interaction(self, state_name)
                else:
                    self.send_text(
                        _("\n{{rb:You've already asked Clara that. " +\
                        "Ask her something else.}}")
                    )

        else:
            return TerminalNanoBernard.check_command(self)
Example #3
0
    def check_command(self):

        # If self.last_user_input equal to "echo 1" or "echo 3"
        if self.last_user_input in story_replies:

            if self.last_user_input == "echo 1":
                return True

            else:
                if self.echo_hit[self.last_user_input]:
                    self.echo_hit[self.last_user_input] = False
                    reply = pop_story(self.last_user_input)["clara"]
                    self.send_text("\n\n" + reply)

                    # Record that the user got optional info
                    # Replace spaces with underscores
                    user_input = "_".join(self.last_user_input.split(" "))
                    state_name = "clara_{}".format(user_input)
                    record_user_interaction(self, state_name)
                else:
                    self.send_text(
                        "\n{{rb:You've already asked Clara that. "
                        "Ask her something else.}}"
                    )

        else:
            return TerminalNanoBernard.check_command(self)