Previous (%) command throws error on Rivescript playground test?

117 Views Asked by At

I am creating a dating app chat bot on Rivescript, and am trying to use the % previous command to trigger a conditional topic on the subject of arranging a date, however when I try to use the % previous command, I get the attached error message that informs me that I cannot use % as a trigger.

This is the error I get: Error in your RiveScript code: Syntax error: Triggers can't contain uppercase letters, backslashes or dots in UTF-8 mode at stream() line 186 near % thats funny. wanna hang out sometime? I'm using the 'Rivescript Playground' here: https://play.rivescript.com/ - I've pasted the relevant code below but have missed out the substitutes for brevity's sake

+ hello
- hey!{weight=5}
- hey cutie{weight=2}
- hey ur cute{weight=1}
- hey ur cute, wanna go on a date?{weight=1}

+ hey
@hello

+ yo
@hello

+ good *
@hello

+ hey*
@hello

+ [*] hows your [*] going
- it is going well thank u. and u?
- it is good. how is urs?
- i am enjoying myself. and u?

+ how are you
- i am well. and you?
- i am fine, how r u 
- not too bad thanks. how are you babe?
- enjoying my day thank you

+ my name is *
- <set name=<formal>>Nice to meet you, <get name>.

+ *
- sorry, i don't understand
- can you rephrase that babe
- ur cute 
- how can u be so cute
- thats funny. wanna hang out sometime?

+ *
% thats funny. wanna hang out sometime?
== [*]no[*]
== [*]yes|ok[*]{topic=date}

> topic date

< topic
1

There are 1 best solutions below

0
On

According to the error message and the GoDoc-documentation you can't have dots in UTF-8-Mode.

Syntax error: Triggers can't contain uppercase letters, backslashes or dots in UTF-8 mode

The error is thrown because the trigger string contains a dot.

% thats funny. wanna hang out sometime?