This commit is contained in:
Bxio 2025-04-27 03:03:13 +01:00
parent a317532d98
commit 94143fb60e

View File

@ -76,9 +76,13 @@ module.exports = {
if (member.roles.cache.has(cargo)) { if (member.roles.cache.has(cargo)) {
return await interaction.editReply({ content: `❗ O membro ${nome.username} já possui o cargo <@&${cargo}>.`, ephemeral: true }); return await interaction.editReply({ content: `❗ O membro ${nome.username} já possui o cargo <@&${cargo}>.`, ephemeral: true });
} }
console.log(member.roles.add(cargo));
// 5 - Adicionar o cargo // 5 - Adicionar o cargo
await member.roles.add(cargo); try {
await member.roles.add(cargo);
console.log('✅ Cargo adicionado com sucesso!');
} catch (error) {
console.error('❌ Erro ao adicionar o cargo:', error);
}
} catch (error) { } catch (error) {
console.error(error); console.error(error);
await interaction.editReply({ content: '❌ Erro ao adicionar membro ou atribuir cargo.', ephemeral: true }); await interaction.editReply({ content: '❌ Erro ao adicionar membro ou atribuir cargo.', ephemeral: true });