Skip to content

Commit

Permalink
feat(metrics): add metric for locales
Browse files Browse the repository at this point in the history
  • Loading branch information
tippfehlr committed Apr 13, 2024
1 parent 2f304f7 commit 9bdb0dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import path from 'path';
import { locales, log } from './messages';
import { DB, ActivityRoles, Guilds, StatusRoles, Users } from './db.types';
import config from './config';
import { writeIntPoint } from './metrics';

export const pool = new Pool({ connectionString: config.DATABASE_URL, max: 10 });
const dialect = new PostgresDialect({ pool });
Expand Down Expand Up @@ -99,6 +100,7 @@ export async function getStatusRoles(guildID: string): Promise<Selectable<Status
}

export function getLang(interaction: CommandInteraction | StringSelectMenuInteraction): string {
writeIntPoint('locale', interaction.locale, 1);
if (locales.includes(interaction.locale)) return interaction.locale;
else return 'en-US';
}
Expand Down

0 comments on commit 9bdb0dd

Please sign in to comment.