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 it safe to call rs.loadDirectory() multiple times on the same instance? #156

Closed
julien-c opened this issue Aug 22, 2016 · 2 comments
Closed

Comments

@julien-c
Copy link
Contributor

Hi,

what's the best way to "refresh" a bot's brain when e.g. updating the files: should I just create a new RiveScript() and loadDirectory() each time, or is it safe to call loadDirectory over and over again with the same argument?

Is there a better way?

Thanks!

@kirsle
Copy link
Member

kirsle commented Aug 22, 2016

Yeah, create a new RiveScript to reload the brain. A long time ago it used to be enough to just loadDirectory() again and data for new triggers would replace those for the existing triggers, but now the triggers are appended to a list and duplicates are technically allowed which doesn't work out so well when you just wanted to reload the bot.

@julien-c
Copy link
Contributor Author

Got it, thanks. The examples in the repo are great, but it's sometimes a bit hard to figure out how it actually works inside.

Thanks a lot for your help.

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

2 participants