CodecademyCommunity / codecademy-discord-bot

Custom moderation bot for the official Codecademy Community Discord server.
https://codecademycommunity.github.io/
MIT License
11 stars 1 forks source link

Added cc!records command #212

Closed lyallstewart closed 3 years ago

lyallstewart commented 3 years ago

What issue is this solving?

Closes #162

Description

Adds a single command ( cc!rapsheet ) as a shortcut to get both the notes and infractions for a user, as described in #162 image

Any helpful knowledge/context for the reviewer?

Please make sure you've attempted to meet the following coding standards

lyallstewart commented 3 years ago

Thanks for the review @Victoria-DR,

I'll push a commit changing the name of the command - cc!records sounds good to me! What would you and @aedwardg suggest as the best alternative to get the notes and infractions instead of exporting/calling it?

aedwardg commented 3 years ago

I think the cc!rapsheet name was probably my fault since I jokingly put that in the original issue 😂 but I agree with Victoria that we should be a little more conscious about the name and records works.

As for the alternative way to fetch the infractions/notes, I think if multiple commands are going to use the same functionality then that functionality should live in its own module, which is designed to be reused and can be imported into the commands as necessary. This is a higher-level code structure preference, and I think it's fine to do it in a follow-up refactor PR. Your current solution works, and you did a great job keeping the code DRY, so let's just transition to the new name and then we can spec out a new issue for the modularization of the record fetching.