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

"?" is not handled in the triggers #331

Open
rblanc99 opened this issue Nov 29, 2019 · 2 comments
Open

"?" is not handled in the triggers #331

rblanc99 opened this issue Nov 29, 2019 · 2 comments

Comments

@rblanc99
Copy link

rblanc99 commented Nov 29, 2019

I am using Rivescript in a Node project.

I want to make the bot recognize questions, so i would like to do something like

+ * ? 
- {topic=questions}

But unfortunately, the bot can't handle the "?", I get a Triggers may only contain lowercase letters, numbers, and these symbols: ( | ) [ ] * _ # { } < > = / error.

I would very much appreciate that feature, thanks !

(Maybe this issue belongs in the rivescript repo and not rivescript-js, wasn't sure about it, sorry)

@dcsan
Copy link
Contributor

dcsan commented Nov 30, 2019

i think that because rivescript uses a simplified version of regex, this feature would be hard to support.
the simpler form makes it really easy for non-tech authors to use, but means more sophisticated regex features are missing.
there was some thought of adding true regex but not much requests for that right now.
#320

@kirsle
Copy link
Member

kirsle commented Dec 2, 2019

Perhaps an alternative way to detect questions is to look at the first word of the message?

+ (who|what|how|why|when) *
- {topic=questions}{@<star1> <star2>}

Alternatively, your bot code can look for the ? mark and set a user variable before calling reply().

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

No branches or pull requests

3 participants