-
Notifications
You must be signed in to change notification settings - Fork 3
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
!random with numbers doesn't work #396
Comments
Looks like this doesn't work. We're converting a string to a string, which wasn't broken. Sorry about this; I should've caught this during code review. |
I need help understanding the logic here @zuzak - Is this statement saying in real terms if the message is two words long (!random 12) : In this case we just need to change to res.toString in order to solve this issue - although I still don't fully understand the else logic, nor how the math actually works (Where in the below statement it uses the number we specified?)
Is the logic here saying return output of ([random number between 0-1] * the second 'word' (number) from the !random 12 command) rounded up to the nearest whole number? |
* Update random.js Fixed #396 - Removed pointless conversion and var and added conversion to var 'res' - This is because the handler can't interpreit var's with properties other than string. This is a greater problem and should probably be re-visitied. * Update random.js
You should be able to do
!random 5
but the bot doesn't output anything if you try.I think this is because the function in question outputs a Number: https://github.com/zuzakistan/civilservant/blob/master/modules/random.js#L8
whereas the output formatter doesn't support it: https://github.com/zuzakistan/civilservant/blob/master/modules/_commands.js#L6-L21
To fix this bug, either:
The text was updated successfully, but these errors were encountered: