diff --git a/src/commands/Community/adicionar_membro.js b/src/commands/Community/adicionar_membro.js index 73b97e6..325d57c 100644 --- a/src/commands/Community/adicionar_membro.js +++ b/src/commands/Community/adicionar_membro.js @@ -1,5 +1,5 @@ // comandos/add.js -const { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, MessageFlags } = require('discord.js'); +const { InteractionContextType, EmbedBuilder, PermissionFlagsBits, SlashCommandBuilder, MessageFlags } = require('discord.js'); const conn = require('../../../database/db'); // Ajusta o caminho @@ -52,15 +52,12 @@ module.exports = { try { - // 1 - Verificar se já existe no banco - const [existing] = await conn.execute( - `SELECT * FROM users WHERE discord_id = ?`, - [nome.id] - ); + // 1 - Verificar se já existe no banco + const [existing] = await conn.execute(`SELECT * FROM users WHERE discord_id = ?`, [nome.id]); - if (existing.length > 0) { - return await interaction.editReply({ content: `❗ O membro ${nome.username} já está registrado no banco de dados.`, ephemeral: true }); - } + if (existing.length > 0) { + return await interaction.editReply({ content: `❗ O membro ${nome.username} já está registrado no banco de dados.`, ephemeral: true }); + } // 2 - Inserir no banco await conn.execute( @@ -92,5 +89,23 @@ module.exports = { console.error('❌ Erro ao adicionar o cargo:', error); } + + const embed = new EmbedBuilder() + .setTitle('📋 Informações do Membro') + .setColor('Green') + .setDescription(` +\`\`\` +Nome | Cargo | ID +------------------------------------------- +${nome.username} | ${cargo} | ${nome.id} +\`\`\` +`) + .setFooter({ text: 'Adicionado à base de dados ✅' }); + +await interaction.editReply({ embeds: [embed] }); + + + + }, }; \ No newline at end of file