This commit is contained in:
parent
4376cd8302
commit
0adc4641cf
@ -94,15 +94,46 @@ 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: '🛠️ Clica no botão para escolher o recurso:',
|
content: collectorText,
|
||||||
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