Questions tagged [rivescript]

RiveScript is a simple scripting language for chatbots with a friendly, easy to learn syntax. It also allows to have scripts defined in Go, Java, JavaScript, Perl or Python.

RiveScript is a simple scripting language for chatbots with a friendly, easy to learn syntax. It also allows to have scripts defined in Go, Java, JavaScript, Perl or Python.

It allows you define the answers of a bot based on a certain human text:

+ hello bot
- Hello, human!

Then when the human says 'hello bot', the bot returns 'Hello, human!'. But also variables, functions, and scripts of other languages can be used.

A tutorial can be found on: https://www.rivescript.com/docs/tutorial.

And to try the scrips you can use:

Or you can download an interpreter for your own language (Go, Java, JavaScript, Perl, Python, C#, PHP): https://www.rivescript.com/interpreters

21 questions
8
votes
1 answer

How to convert Ajax to Fetch API in JavaScript?

So I am using the JavaScript port of RiveScript which uses ajax and of course I don't want to use jQuery anymore. There is only one line ajax and I want to change it to the new Fetch API. **FYI: You can see the ajax code in line 1795 of the…
wobsoriano
  • 12,348
  • 24
  • 92
  • 162
6
votes
2 answers

How to preprocess a special trigger in Rivescript-Python?

My bot stores the name of the user in a database, and, from time to time, the database sends the session a message “setname username”. Sample rivescript: + setname * - > + (what is my name|who am i) - You're , right? +…
staticdev
  • 2,950
  • 8
  • 42
  • 66
3
votes
1 answer

How to make a synchronous get request in javascript object macros of RiveScript?

I’m new to rivescript i want to make a synchronous ajax get request in javascript object macros of RiveScript. I will be very grateful if anyone can help. Thanks
monsoonrainbow
  • 149
  • 3
  • 10
3
votes
1 answer

How to execute a Python3 object macro within Rivescript ".rive" script?

I have the following code within the .rive file for RiveScript Interpreter, the code basically will say hello world when the user type the command "give me result": > object base64 python import base64 as b64 return b64.b64encode("…
0x01Brain
  • 798
  • 2
  • 12
  • 28
2
votes
2 answers

Rivescript: Using Keyword Triggers in Conditional Responses

I am working on a chatbot with Rivescript and am trying to use keyword triggers in conditional responses. In the tutorial on the site, it is explained that you can use... [*] optionals to ignore parts of a message... This works fine in the…
Jack Clarke
  • 499
  • 5
  • 20
2
votes
1 answer

Parsing regex with alternatives and optionals

I'm building a chatbot subset of RiveScript and trying to build the pattern matching parser with regular expression. Which three regexes match the following three examples? ex1: I am * years old valid match: - "I am 24 years old" invalid match: - "I…
MiP
  • 499
  • 1
  • 7
  • 16
1
vote
0 answers

Can't access to the variable in object macro after just defining the variable (rivescript)

# in python > object tempCall python return 'right' < object < object test python temp_query = rs.get_uservar(rs.current_user(),"temp_query") print(temp_query) > object # in rivescript + xyz (x|y|z) -
1
vote
0 answers

The sortReplies() function is not working using Rivescript

I am using Rivescript to build a simple chatbot but when I run the file, the chatbots replies with an error ERR: Replies Not Sorted. function botReady() { bot.sortReplies(); botReply('Hello'); }
1
vote
1 answer

How to bring variable values from csv to rivescript?

In rivescript, if a user asks me the price of a certain item, I want the bot to look for that items' price in the csv file. Im new to to rivescript so any kind of help would be appreciated.
1
vote
0 answers

Sending File attachment JSON format to Slack

I tried with the below Json format to send file attachment response from by bot to slack but here I get the the same Json object on the client Here,it's not converting to the attachment format Please below is my json let me know if I'am in a wrong…
kalyan.
  • 5
  • 6
1
vote
2 answers

RiveScript gives an error for python object macros

Is it possible to access the object macros internally in RiveScript? I'm bit confused with that. I have defined the following script: > object small python return "4" < object + small - small Which gives me an error when I enter…
0
votes
0 answers

I have installed axiom/rivescript with Composer for a PHP project I can't instantiate the rivescript object

I install rivescript with Composer and there doesn't seem to be any problem, but when I create the index file, it doesn't let me instantiate the object, it's like it doesn't recognize the class, I attach here the index file, the autoload file and…
0
votes
0 answers

How to use topics in rivescript

I´m trying to program a bot on rivescript, I installed rivescript´s libraries on a server o Alwaysdata, the version is rivescript 1.15 and I´m programing a phyton file using rivescript. But when I used "topics" i looks like it doesn´t recognise that…
0
votes
1 answer

How to use RiveScript in Node.js to reply with a Facebook Messenger bot

Currently, I keep receiving Promise, and the error User localuser was in an empty topic named 'random'. My code is structured like this const bot = new RiveScript(); bot.loadDirectory("./brain"); bot.sortReplies(); Below is in a function // blah …
0
votes
1 answer

I need a logic understanding for Rivescript Conditional syntaxes

! var name = Alex + my name is * * == => Wow, we have the same name!> * == undefined => >Nice to meet you! - >> I thought your name was…
1
2