hubot-markov
hubot-markov copied to clipboard
HUBOT_MARKOV_RESPOND_CHANCE env var cannot contain '.'
we've set the env var HUBOT_MARKOV_RESPOND_CHANCE
to 0.005
for very infrequent but very humorous responses.
Unfortunately this line... https://github.com/smashwilson/hubot-markov/blob/master/src/config.coffee#L6 tests for digits and fails on '.'
can I suggest
/^[-+]?[0-9]*\.?[0-9]+$/.test
Thanks for helping us to brighten our days with markov enabled hubot!
I fixed it by setting it like this:
respondChance: parseFloat(hash.HUBOT_MARKOV_RESPOND_CHANCE)
The fix also requires in default-listeners.coffee changing preprocessor.words(
to processors.words.pre(
@bnfinet have you sent a pull request for this? Your fix worked for me.
Fixed in #29