AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

How to get an email from client ?
 
 

Hi everyone,

I tried to write a rivescript file with content as following:

// local substitutions
! sub @ = atsign
! sub . = dot

+ *atsign*dot*
- Your email is <star1>@<star2>.<star3>

Above i have a trigger without space. But it failed to catch client’s email!
Please help me how can i get an email from client ?

Thanks in advance!

 

 
  [ # 1 ]

Hey,

Currently RiveScript itself doesn’t support this. :( Substitutions are for whole words, so “@ = atsign” doesn’t work unless the @ was a “word” by itself (spaces on both sides).

You may be able to do this substitution outside of RiveScript, i.e. if you’re using the Perl version, substitute it out with Perl before passing the message to RiveScript.

$message =~ s/@/ atsign /g;
$message =~ s/\./ dot /g;
my $reply = $rs->reply($user, $message);

It’s on my radar to implement some Unicode support into all the RiveScript libraries, which will allow triggers to contain non-ASCII characters (useful for foreign languages), and user messages will be stripped of less characters so that a user could tell the bot their e-mail, and the <star> tag will be literally what the user said, and not the stripped version of it like what happens now.

 

 
  [ # 2 ]

Noah, thank you for replying and useful suggestion!

I will try to do it outside of RiveScript. (y)

 

 
  login or register to react