Skip to content

Commit

Permalink
v1.22.2 leader fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoG committed Apr 2, 2018
1 parent 093fa21 commit 579cff0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The Commands of the bot are its API so here's how it will adhere to Semantic Ver
**MINOR** - Adding new commands or functionality that won't affect or break existing ones
**PATCH** - Bug fixes, code improvements (backwards-compatible bug fixes)

## [1.22.2] - 2018-04-01
### Fixed
- fixed the monthly point reset always crashing.
- fixed accessing property of undefined error in !leaders commad

## [1.22.1] - 2018-03-23
### Fixed
- increased the bot warning time back to 12 hours
Expand Down
18 changes: 12 additions & 6 deletions bot/commands/credits/leaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ module.exports = function(bot, db, data) {

bot.sendChat( `Current leaders for ${month_full} ${year} are:` );

bot.sendChat( 'By *props* :heart: :musical_note: :fist: :fire: etc...' );
bot.sendChat( bot.leaderboard[ month + year ].props );

bot.sendChat( 'By *flow* :surfer:');
bot.sendChat( bot.leaderboard[ month + year ].flow );
let current_board = bot.leaderboard[ month + year ];

bot.sendChat( 'points will reset at the end of every month' );
if (!current_board) {
return bot.sendChat(`Error accessing data for ${month_full} ${year}`);
}

let info = `By *props* :heart: :musical_note: :fist: :fire: etc...
${current_board.props}
By *flow* :surfer:
${ current_board.flow }
points will reset at the end of every month
`;
bot.sendChat(info);
};

2 changes: 1 addition & 1 deletion bot/utilities/point-reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = function pointReset(bot, db){
// setTimeout(()=>{resetAllUserPoints(bot, db);}, 10000);

// this will run once a month, on the first of the month, at midnight
var monthly = schedule.scheduleJob('0 0 1 * *', function(){
var monthly = schedule.scheduleJob('15 0 1 * *', function(){
// go through every user and reset their points
resetAllUserPoints(bot, db);
});
Expand Down

0 comments on commit 579cff0

Please sign in to comment.