Skip to content

Commit

Permalink
fix(vote): rely on database instead of top.gg api for checking votes
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Feb 26, 2024
1 parent 09edeca commit 72e1a5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/context-menu/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from 'discord.js';
import db from '../../utils/Db.js';
import BaseCommand from '../../core/BaseCommand.js';
import { hasVoted } from '../../utils/Utils.js';
import { userVotedToday } from '../../utils/Utils.js';
import { RegisterInteractionHandler } from '../../decorators/Interaction.js';
import { CustomID } from '../../utils/CustomID.js';
import { t } from '../../utils/Locale.js';
Expand All @@ -33,7 +33,7 @@ export default class Translate extends BaseCommand {
async execute(interaction: MessageContextMenuCommandInteraction) {
await interaction.deferReply({ ephemeral: true });

if (!(await hasVoted(interaction.user.id))) {
if (!(await userVotedToday(interaction.user.id))) {
return await interaction.editReply(
t({ phrase: 'errors.mustVote', locale: interaction.user.locale }, { emoji: emojis.no }),
);
Expand Down

0 comments on commit 72e1a5d

Please sign in to comment.