Skip to content

Award bonus points#119

Merged
krogers78 merged 7 commits intorewardsSystemfrom
award-bonus-points
Mar 13, 2018
Merged

Award bonus points#119
krogers78 merged 7 commits intorewardsSystemfrom
award-bonus-points

Conversation

@drubiodev
Copy link

No description provided.

},
);
let { messagesCount } = memberData[0].dataValues;
let { points } = memberData[0].dataValues;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! If you wanted to you could condense these two lines into one. When deconstructing a variable, you can add multiple items... For example here you could say let { messagesCount, points } = memberData[0].dataValues; and it would say the same thing with one less line of code. They could also be made a const too since they don't change.

package.json Outdated
"uuid": "^3.1.0"
},
"devDependencies": {
"mysql": "^2.15.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you are using mysql dependence for?

bot/client.js Outdated
// Check if its greater or equal to numberOfMessagesForBonus
if (messagesCount >= numberOfMessagesForBonus) {
points += amountOfBonusPoints;
messagesCount = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick input, I noticed this is going to affect the points that users gain from regularly chatting. That feature directly uses the messagesCount to determine how many points the users have earned through chatting. If there would be a way to implement this without resetting the message count to zero each time that would be great.

@krogers78 krogers78 merged commit 6c81fb2 into rewardsSystem Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants