Skip to content

Commit

Permalink
add 1.0.0-rc.3 changelog and version
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgauthier committed Jan 26, 2019
1 parent d538f55 commit 8e3bef0
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
15 changes: 15 additions & 0 deletions changelogs/1.0.0-rc.3_changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# TaylorBot Release Notes 📝
`v1.0.0-rc.3` - `2019.01.26`

- **DailyPayout** command now tracks the number of consecutive days you redeemed your payout. Redeem 5 days in a row to get bonus points! 💰
- All daily payouts now reset at the same time (midnight utc time), no more waiting exactly 24 hours! ⌛

- **UrbanDictionary**, **YouTube** and **Image** commands now have a button to cancel and delete the command. ❌

- Remove bots from all rankings except joined. 🤖

- **Help** command when used with no command name now provides a list of featured commands. 📖

- Reddit post notifications now use the full picture as thumbnail for direct imgur links. 🔎

- Lots of minor improvements and fixes. 📈
4 changes: 2 additions & 2 deletions src/attributes/member/Taypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class TaypointsMemberAttribute extends SimpleStatMemberAttribute {
}

retrieve(database, member) {
return database.guildMembers.getRankedForeignStatFor(member, 'users', 'users', this.columnName);
return database.guildMembers.getRankedTaypointsFor(member);
}

rank(database, guild, entries) {
return database.guildMembers.getRankedForeignStat(guild, entries, 'users', 'users', this.columnName);
return database.guildMembers.getRankedTaypoints(guild, entries);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/database/repositories/DailyPayoutRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class DailyPayoutRepository {
async getCanRedeem(user) {
try {
return await this._db.oneOrNone(
`SELECT last_payout_at < (CURRENT_TIMESTAMP at time zone 'EST')::date AS can_redeem,
((CURRENT_TIMESTAMP + INTERVAL '1 DAY') at time zone 'EST')::date::timestamp with time zone AS can_redeem_at
`SELECT last_payout_at < date_trunc('day', CURRENT_TIMESTAMP) AS can_redeem,
date_trunc('day', ((CURRENT_TIMESTAMP + INTERVAL '1 DAY'))) AS can_redeem_at
FROM users.daily_payouts WHERE user_id = $[user_id];`,
{
user_id: user.id
Expand All @@ -35,7 +35,7 @@ class DailyPayoutRepository {
ON CONFLICT (user_id) DO UPDATE SET
last_payout_at = CURRENT_TIMESTAMP,
streak_count = (
CASE WHEN (daily_payouts.last_payout_at > ((CURRENT_TIMESTAMP - INTERVAL '1 DAY') at time zone 'EST')::date::timestamp with time zone)
CASE WHEN (daily_payouts.last_payout_at > date_trunc('day', (CURRENT_TIMESTAMP - INTERVAL '1 DAY')))
THEN daily_payouts.streak_count + 1
ELSE 1
END)
Expand Down
8 changes: 8 additions & 0 deletions src/database/repositories/GuildMemberRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ class GuildMemberRepository {
return this._getRankedAliveFor(guildMember, 'minute_count');
}

getRankedTaypoints(guild, limit) {
return this._getRankedUsers(guild, limit, 'taypoint_count');
}

getRankedTaypointsFor(guildMember) {
return this._getRankedAliveFor(guildMember, 'taypoint_count');
}

getRankedForeignStat(guild, limit, schema, table, column) {
return this._getRankedAliveForeign(guild, limit, new this._helpers.TableName(table, schema), column);
}
Expand Down
2 changes: 1 addition & 1 deletion src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taylorbot",
"version": "1.0.0-rc.2",
"version": "1.0.0-rc.3",
"description": "Discord bot created for the r/TaylorSwift Discord server",
"main": "taylorbot.js",
"dependencies": {
Expand Down

0 comments on commit 8e3bef0

Please sign in to comment.