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

HUBOT_MARKOV_RESPOND_CHANCE env var cannot contain '.' #25

Open
bnfinet opened this issue Jun 28, 2017 · 4 comments
Open

HUBOT_MARKOV_RESPOND_CHANCE env var cannot contain '.' #25

bnfinet opened this issue Jun 28, 2017 · 4 comments

Comments

@bnfinet
Copy link

bnfinet commented Jun 28, 2017

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!

@baudehlo
Copy link

baudehlo commented Aug 2, 2017

I fixed it by setting it like this:

    respondChance: parseFloat(hash.HUBOT_MARKOV_RESPOND_CHANCE)

@baudehlo
Copy link

baudehlo commented Aug 2, 2017

The fix also requires in default-listeners.coffee changing preprocessor.words( to processors.words.pre(

@scarolan
Copy link

@bnfinet have you sent a pull request for this? Your fix worked for me.

@Bajotumn
Copy link

Bajotumn commented Feb 6, 2019

Fixed in #29

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

4 participants