aichaos / rivescript-js

A RiveScript interpreter for JavaScript. RiveScript is a scripting language for chatterbots.
https://www.rivescript.com/
MIT License
377 stars 145 forks source link

self._node.readFile is not a function #311

Closed CiaraG98 closed 3 years ago

CiaraG98 commented 5 years ago

I am trying to use the npm rivescript package with Typescript (assuming it can be done) and whenever 'bot.loadFile()' is called I get the same error from the rivescript.js file in the package saying 'self._node.fs.readFile()' is not a function. Is this an error in the code or is the code not compatible with Typescript? This is how far the code runs before the error occurs:

bot = new RiveScript({utf8: true}); bot.loadFile("brain.rive").then(botReady).catch(botError);

Thanks