Prefix command that sends an example of a message with a select menu. To run code in response to a selection, add another endpoint with "message.selectmenu.interaction" as your trigger with the same custom id as the select menu.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
if (context.params.event.content.startsWith('!selectmenu')) {
await lib.discord.channels['@0.1.2'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `Which emojis do you like?`,
components: [
{
type: 1,
components: [
{
type: 3,
custom_id: 'custom_id_matching_your_handler',
options: [
{
label: 'Slightly smiling face',
value: 'slightly_smiling_face',
description: 'This is the basic smily face',
emoji: {
name: 'π',
},
},
{
label: '100',
value: '100',
description: 'This is a 100 emoji',
emoji: {
name: 'π―',
},
},
{
label: 'Joy',
value: 'joy',
description: 'This is a joy emoji',
emoji: {
name: 'π',
},
},
{
label: 'Firaga',
value: 'firaga',
description: 'This is a custom emoji',
emoji: {
name: 'firaga',
id: '837125081763282955',
},
},
],
placeholder: 'Choose emojis',
min_values: 1,
max_values: 3,
},
],
},
],
});
}