Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip doesn't accept boolean type #176

Closed
gabrielpeixoto opened this issue Jun 19, 2019 · 1 comment · Fixed by #177
Closed

Skip doesn't accept boolean type #176

gabrielpeixoto opened this issue Jun 19, 2019 · 1 comment · Fixed by #177
Labels

Comments

@gabrielpeixoto
Copy link

Example:

- Hello! I'm Yve Bot.

- message: What's your name?
  name: name
  type: String
  replyMessage: Thanks for the answer, {name}!
  validators:
  - min: 4
  - minWords: 1

- message: What city do you live in?
  name: city
  multiline: false
  type: String

- message: I'll skip this message
  skip: true

- message: Thanks, wait a moment.

The message "I'll skip this message" won't appear. OK.

Example 2:

- Hello! I'm Yve Bot.

- message: What's your name?
  name: name
  type: String
  replyMessage: Thanks for the answer, {name}!
  validators:
  - min: 4
  - minWords: 1

- message: What city do you live in?
  name: city
  multiline: false
  type: String

- message: I'll skip this message
  skip: false

- message: Thanks, wait a moment.

The message "I'll skip this message" won't appear. not OK, because I don't want to skip the message.

But if the value of skip is a function, it works normally. Example 3:

- Hello! I'm Yve Bot.

- message: What's your name?
  name: name
  type: String
  replyMessage: Thanks for the answer, {name}!
  validators:
  - min: 4
  - minWords: 1

- message: What city do you live in?
  name: city
  multiline: false
  type: String

- message: I'll skip this message
  skip: !!js/function >
    function skip(output, rule, bot) {
      return false;
    }

- message: Thanks, wait a moment.

The Example 3 is OK, show the message "I'll skip this message"

@andersonba
Copy link
Owner

Nice catch! Thanks for the report. I will fix in a patch version.
I'm working on a new version v2, some things are changing, as well as improvements and a better-defined API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants