This will reset a select menu back to 'Make a selection' after the user selects a value.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
// Update the message with same the data to reset the selected option
await lib.discord.channels['@0.1.1'].messages.update({
message_id: context.params.event.message.id,
channel_id: context.params.event.message.channel_id,
content: context.params.event.message.content,
embeds: context.params.event.message.embeds,
components: context.params.event.message.components,
});
// ** DEV ** Get the selected value and do something with it
const selectedValue = context.params.event.data.values[0];
await lib.discord.channels['@0.1.2'].messages.create({
channel_id: context.params.event.message.channel_id,
content: `You selected '${selectedValue}'`,
});