diff --git a/commands/admin/autoresponse.js b/commands/admin/autoresponse.js index 97f79135..34255a6f 100644 --- a/commands/admin/autoresponse.js +++ b/commands/admin/autoresponse.js @@ -4,9 +4,9 @@ import db from '../../models/index.js'; export default { data: new SlashCommandBuilder() .setName('autoresponse') - .setDescription('Enable or disable autoresponse'), + .setDescription('Enable or disable autoresponse') + .setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages), category: 'admin', - userPermissions: [PermissionFlagsBits.ManageMessages], async execute(interaction, args, client) { const autoresponseStat = await db.autoresponseStat.findOne({ where: { serverID: interaction.guild.id } }); diff --git a/commands/admin/quotation.js b/commands/admin/quotation.js index bcc4a41a..78395672 100644 --- a/commands/admin/quotation.js +++ b/commands/admin/quotation.js @@ -4,9 +4,9 @@ import db from '../../models/index.js'; export default { data: new SlashCommandBuilder() .setName('quotation') - .setDescription('Enable or disable quotations'), + .setDescription('Enable or disable quotations') + .setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages), category: 'admin', - userPermissions: [PermissionFlagsBits.ManageMessages], async execute(interaction, args, client) { const quotationstat = await db.quotationstat.findOne({ where: { serverID: interaction.guild.id } }); diff --git a/events/client/interactionCreate.js b/events/client/interactionCreate.js index 8a7606f4..bd876b83 100644 --- a/events/client/interactionCreate.js +++ b/events/client/interactionCreate.js @@ -37,7 +37,7 @@ export default { } // Check if the bot has the needed permissions - if (command.clientPermissions) { + if (command.default_permission) { const clientMember = await interaction.guild.members.fetch(client.user.id); if (!clientMember.permissions.has(command.clientPermissions)) { return interaction.reply({ content: `❌ I am missing one of the following permission(s): \`${new PermissionFlagsBits(command.clientPermissions).toArray()}\``, ephemeral: true }); @@ -45,11 +45,13 @@ export default { } // Check if the user has the needed permissions - if (command.userPermissions) { + /* + if (command.default_member_permissions) { if (!interaction.member.permissions.has(command.userPermissions)) { return interaction.reply({ content: `❌ You are missing one of the following permission(s): \`${new PermissionFlagsBits(command.userPermissions).toArray()}\``, ephemeral: true }); } } + */ try { const date = new Date(); @@ -77,7 +79,6 @@ export default { const args = []; interaction.options.data.forEach(arg => { - console.log(arg); if (arg.type === 'MENTIONABLE') { return args.push(arg.member); } diff --git a/events/client/messageCreate.js b/events/client/messageCreate.js index a7c0e50d..d1287180 100644 --- a/events/client/messageCreate.js +++ b/events/client/messageCreate.js @@ -7,8 +7,6 @@ import db from '../../models/index.js'; import { rand } from '../../utils/rand.js'; const ratelimit = {}; -import dotenv from 'dotenv'; -dotenv.config(); const { ownerId, prefix } = process.env; const prefixs = prefix.split(','); @@ -308,8 +306,8 @@ export default { } // Check if the user has the needed permissions - if (command.userPermissions) { - if (!message.member.permissions.has(command.userPermissions)) { + if (command.default_member_permissions) { + if (!message.member.permissions.has(command.default_member_permissions)) { return message.reply({ content: `❌ You are missing one of the following permission(s): \`${new PermissionFlagsBits(command.userPermissions).toArray()}\``, ephemeral: true }); } }