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

processOutput() should handle numbers #402

Open
zuzak opened this issue Jan 14, 2020 · 0 comments
Open

processOutput() should handle numbers #402

zuzak opened this issue Jan 14, 2020 · 0 comments
Labels
feature request good first issue infrastructure related to core function that influences how modules are written or executed

Comments

@zuzak
Copy link
Contributor

zuzak commented Jan 14, 2020

If a command's function returns a Number, the bot won't output it to a channel. It probably should. This arose in #396.

To fix this, processOutput() should be updated to handle passing in numbers.

The best option is perhaps:

  • check if the output is a number
  • if it is, convert the number to a string
  • call the processOutput a second time (i.e. recursively)

Something like this:

if (typeof output === 'number') {
   output = output.toString()
   return processOutput(bot, msg, cmd, output, customFormatter)
}
@zuzak zuzak added good first issue infrastructure related to core function that influences how modules are written or executed feature request labels Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue infrastructure related to core function that influences how modules are written or executed
Projects
None yet
Development

No branches or pull requests

1 participant