This commit is contained in:
parent
ed6603e365
commit
77fc61f7e1
@ -94,42 +94,12 @@ module.exports = {
|
|||||||
.setStyle(1) // Usando o valor numérico para PRIMARY (1)
|
.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({
|
await interaction.editReply({
|
||||||
content: collectorText,
|
content: '🛠️ Clica no botão para escolher o recurso:',
|
||||||
components: [rowButton],
|
components: [rowButton],
|
||||||
ephemeral: true,
|
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) {
|
} catch (error) {
|
||||||
console.error('Erro ao buscar usuários:', error);
|
console.error('Erro ao buscar usuários:', error);
|
||||||
await interaction.editReply({ content: '❌ Erro ao carregar informações dos usuários.' });
|
await interaction.editReply({ content: '❌ Erro ao carregar informações dos usuários.' });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user