This commit is contained in:
parent
d3c97d7971
commit
bc861f8e4f
@ -91,7 +91,7 @@ const {
|
|||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setCustomId('mostrarDropdown')
|
.setCustomId('mostrarDropdown')
|
||||||
.setLabel('Escolher Recurso')
|
.setLabel('Escolher Recurso')
|
||||||
.setStyle(1)
|
.setStyle(1) // Usando o valor numérico para PRIMARY (1)
|
||||||
);
|
);
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
@ -102,27 +102,4 @@ const {
|
|||||||
|
|
||||||
// Espera pelo clique no botão
|
// Espera pelo clique no botão
|
||||||
const filter = (i) => i.customId === 'mostrarDropdown' && i.user.id === interaction.user.id;
|
const filter = (i) => i.customId === 'mostrarDropdown' && i.user.id === interaction.user.id;
|
||||||
const collector = interaction.channel.createMessageComponentCollector({ filter, time: 15000 });
|
const collector = interaction.channel.createMessageComponentCollector({ filter, time: 15000
|
||||||
|
|
||||||
collector.on('collect', async (i) => {
|
|
||||||
if (i.customId === 'mostrarDropdown') {
|
|
||||||
await i.update({
|
|
||||||
content: '🛠️ Agora escolhe o recurso:',
|
|
||||||
components: [rowSelect],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
collector.on('end', (collected) => {
|
|
||||||
if (collected.size === 0) {
|
|
||||||
interaction.editReply({ content: '❌ O tempo para escolher o recurso expirou.' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Erro ao buscar usuários:', error);
|
|
||||||
await interaction.editReply({ content: '❌ Erro ao carregar informações dos usuários.' });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user