codebuddies / greetbot

Slackbot for greeting new codebuddies users
MIT License
9 stars 14 forks source link

Refactor #15

Closed BethanyG closed 6 years ago

BethanyG commented 6 years ago

First pass at refactoring. Some cleanup still required, but code does work on staging as-is. Would like to further separate commands and data, but am not quite there yet.

angelocordon commented 6 years ago

@BethanyG - outside of the current merge conflicts, I think I see the direction you're going 👍

Other than that, I also feel like this might be all over the place and it might be beneficial if we break this huge task down to multiple issues? A few steps I can see:

☝️I think these are some low hanging fruits that should give us some pretty big wins from a cleani up standpoint. From there and should give us a clearer direction. Thoughts?

BethanyG commented 6 years ago

[ ] Remove unnecessary code / dependencies for now. I.e.:

  • Axios? I don't really see where we're using it or did I miss it?
  • I don't think we need Reminders
  • Remove other test commands parameters (like FOO, or PYTHON)

Axios is used wherever there is a POST to be sent back to Slack - so I don't think we can do without it, unless you have a more lightweight alternative? See the following for usage:

Reminders would theoretically be sent if someone didn't acknowledge our Code of Conduct. This is a larger community discussion, but I think that if someone doesn't want to abide by our COC, then they aren't welcome in the community. The reminder is theoretically set up to run and then create a list of users to poke who aren't in the DB as initially agreeing to the COC - and eventually, the app wold be made to automatically deactivate Slack accounts if the users don't acknowledge our COC.

Other test Commands are in progress. They will eventually be parsed out into their own endpoints, or clarified. I just haven't gotten there yet. I will be logging some issues around that shortly for tracking purposes.

[ ] Separate messages to their own JSON file and import them where necessary.

I tried that, and was having difficulty getting the SLACK_TOKEN parameter in each message to be read/created correctly when importing that message JSON from an external file. The message appeared to be processed correctly in the code, but would then fail authorization on Slack's end. I could really use some help figuring out how to properly read and insert the token when the message is external. Until then, the code only works when the message is in the same file with the function that wraps it up and sends it.