You are viewing a single comment's thread from:

RE: Steem Apps Discord Bot - Utopian-io Submission

in #utopian-io6 years ago

Thank you for your contribution @petertag !

  1. The PR has been outside the 14-day window - but you 've made some great work here, so I'd give a few comments.
  2. a few screenshots on discord could be useful for readers to understand how the bot actually works
  3. type == 4, type > 1 - magic numbers, could be replaced with meaningful names.
  4. I'd expect to see some tests here using e.g. mocha or chai, and you could also set up a CI on https://travis-ci.com
  5. could msg.content be null? should there be a null check? Also, you may use a regexp here e.g. `/^[!$].*/ to make your code look nicer.
  6. For background discord bots, you may want to log to files instead of console.log
  7. if (args && Array.isArray(args)) { is the Array.isArray(args) sufficient enough?
  8. color: 12607945 etc could be customized by moving it to a external json config.
  9. Are you sure that inqs[qs.length - 2] , qs is at least 2 elements?

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Sort:  

Thanks for the quick response justyy! I figured there would be something like that, just wanted to get this post up before the final-ish PR was accepted. I'll include some more screenshots for usage on the next one, as I don't think the bot is active yet and this PR didn't contain most of the currently working parameters.

  1. I'll add in const declarations in the config, I'll probably keep it in the same file as the bot token, will throw the color in there as well.

  2. Honestly wasn't sure if/how to test a Discord bot, used travis-ci before though, I'll check out mocha or chai

  3. Will add a null check in, missed that, assumed the msg wouldn't show up without content when first setting it up, but realize now that embeds can work without.

  4. True, most of the logs were error checking, the login one I thought was important but you can see the bot is online in Discord anyways.

  5. I believe it is, went over a few stackoverflow answers to ensure errors weren't thrown but it also fully checks.

  6. It is, due to the parseArgs pushing in default arguments for sort type, time, and sort order if they are not passed in, but I should probably make that more clear somewhere.

Cheers!

Thank you for your review, @justyy! Keep up the good work!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 62763.51
ETH 2579.20
USDT 1.00
SBD 2.72