This commit is contained in:
Bxio 2025-05-02 00:57:30 +01:00
parent 4376cd8302
commit 0adc4641cf

View File

@ -94,15 +94,46 @@ module.exports = {
.setStyle(1) // Usando o valor numérico para PRIMARY (1)
);
// Armazenar texto do coletor
let collectorText = '🛠️ Clica no botão para escolher o recurso:';
await interaction.editReply({
content: '🛠️ Clica no botão para escolher o recurso:',
content: collectorText,
components: [rowButton],
ephemeral: true,
});
// Espera pelo clique no botão
const filter = (i) => i.customId === 'mostrarDropdown' && i.user.id === interaction.user.id;
const collector = interaction.channel.createMessageComponentCollector({ filter, time: 15000 });
collector.on('collect', async (i) => {
if (i.customId === 'mostrarDropdown') {
collectorText = '🛠️ Agora escolhe o recurso:';
await i.update({
content: collectorText,
components: [rowSelect],
});
}
});
collector.on('end', async (collected) => {
if (collected.size === 0) {
collectorText = '❌ O tempo para escolher o recurso expirou.';
}
// Atualizar o embed final com o texto do coletor
await interaction.editReply({
content: collectorText,
components: [],
});
});
} catch (error) {
console.error('Erro ao buscar usuários:', error);
await interaction.editReply({ content: '❌ Erro ao carregar informações dos usuários.' });
}
},
};