Skip to content

Commit

Permalink
fix: disable activityStats for now
Browse files Browse the repository at this point in the history
  • Loading branch information
tippfehlr committed Aug 24, 2024
1 parent 603b5e1 commit 92a5f45
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/modules/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,18 @@ export function getLang(interaction: CommandInteraction | StringSelectMenuIntera
}

export async function addActivity(guildID: string, activityName: string) {
db.insertInto('activityStats')
.values({ guildID, activityName, count: 1 })
.onConflict(oc =>
oc
.columns(['guildID', 'activityName'])
.doUpdateSet(eb => ({ count: eb('activityStats.count', '+', 1) })),
)
.execute();
// if (activityName.includes('®')) {
// log.warn(`activityName '${activityName}'includes '®'. Somehow postgres doesn’t like this.`);
// return;
// }
// db.insertInto('activityStats')
// .values({ guildID, activityName, count: 1 })
// .onConflict(oc =>
// oc
// .columns(['guildID', 'activityName'])
// .doUpdateSet(eb => ({ count: eb('activityStats.count', '+', 1) })),
// )
// .execute();
}

export async function getRowCount(table: TableExpression<DB, keyof DB>) {
Expand Down

0 comments on commit 92a5f45

Please sign in to comment.