feat(commmands/rank): Update the buyer command's permission check to use the isOwner function

This commit is contained in:
Raphael 2025-11-15 00:33:50 +01:00 committed by Raphaël
parent 5f89afda04
commit e1abcd5b24

View file

@ -4,6 +4,7 @@ import { prisma } from '@lib/prisma';
import { Guild as GuildPrisma, User as UserPrisma } from '@prisma/client'; import { Guild as GuildPrisma, User as UserPrisma } from '@prisma/client';
import emoji from '../../../assets/emoji.json' assert { type: 'json' }; import emoji from '../../../assets/emoji.json' assert { type: 'json' };
import { log } from '@lib/log'; import { log } from '@lib/log';
import { isBuyer } from '@lib/perm.js';
export default { export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
@ -182,7 +183,7 @@ export default {
}); });
return; return;
case 'list': case 'list':
if (!userData.isBuyer) { if (!await isBuyer(interaction.user.id)) {
await interaction.reply({ await interaction.reply({
content: `${emoji.answer.no} | This command is only for buyer`, content: `${emoji.answer.no} | This command is only for buyer`,
flags: MessageFlags.Ephemeral, flags: MessageFlags.Ephemeral,