We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The current source doesn't allow async msgs to be sent back from the brain scripts.
Changing the code for the coffee script to
RiveScript = require "rivescript" module.exports = (robot) -> # Configuration parameters. brain = process.env.HUBOT_RIVESCRIPT_BRAIN or "./brain" prefix = if process.env.HUBOT_RIVESCRIPT_PREFIX then "#{process.env.HUBOT_RIVESCRIPT_PREFIX}\\s+" else "\\s*" utf8 = "#{process.env.HUBOT_RIVESCRIPT_UTF8}" is "1" or false # The matcher regexp. regexp = new RegExp("#{prefix}(.*)", "i") # Initialize the RiveScript brain. @bot = new RiveScript({ utf8: utf8 }) @bot.loadDirectory(brain, -> @bot.sortReplies() robot.respond regexp, (res) -> bot.replyAsync(res.message.user.name, res.match[1]).then (reply) -> res.send reply return #reply = bot.reply(res.message.user.name, res.match[1]) #res.send reply , (err) -> console.error "Couldn't load RiveScript replies: #{err}" )
will allow async msgs to be sent back from the brain
The text was updated successfully, but these errors were encountered:
I've published hubot-rivescript v0.1.1 which incorporates this change.
hubot-rivescript v0.1.1
Async replies are on by default, and can be disabled with HUBOT_RIVESCRIPT_SYNC=1
HUBOT_RIVESCRIPT_SYNC=1
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The current source doesn't allow async msgs to be sent back from the brain scripts.
Changing the code for the coffee script to
will allow async msgs to be sent back from the brain
The text was updated successfully, but these errors were encountered: