phyLayer
phyLayer
DIAdiscord.js - Imagine an app
Created by phyLayer on 10/3/2023 in #djs-questions
Get multiple select menu values on submit
ok thanks, i'll give that a shot
12 replies
DIAdiscord.js - Imagine an app
Created by phyLayer on 10/3/2023 in #djs-questions
Get multiple select menu values on submit
Just making sure i understood the suggestion 🙂
12 replies
DIAdiscord.js - Imagine an app
Created by phyLayer on 10/3/2023 in #djs-questions
Get multiple select menu values on submit
instead of having submit return values in some manner
12 replies
DIAdiscord.js - Imagine an app
Created by phyLayer on 10/3/2023 in #djs-questions
Get multiple select menu values on submit
So store the initial default state, update that state if/when a menu changes, and then end everything on submit
12 replies
DIAdiscord.js - Imagine an app
Created by phyLayer on 10/3/2023 in #djs-questions
Get multiple select menu values on submit
ok so just do change tracking?
12 replies
DIAdiscord.js - Imagine an app
Created by phyLayer on 10/3/2023 in #djs-questions
Get multiple select menu values on submit
DJS version 14.13.0 Node version 18.17.1
/**
* asks the questions to schedule a one time event
* @param {interaction} interaction
* @returns {Date} the date of the event
*/
async function scheduleOneTime(interaction) {
const question = "Please select a time for your event"
const rows = buildTimeSelectMenu("time");
const filter = i => {
return i.user.id === interaction.user.id;
}
const response = await interaction.editReply({
content: question,
components: rows,
})
const collector = response.createMessageComponentCollector()
collector.on('collect', async i => {
console.log(JSON.stringify(i.values));
i.deferUpdate();
})
}
/**
* asks the questions to schedule a one time event
* @param {interaction} interaction
* @returns {Date} the date of the event
*/
async function scheduleOneTime(interaction) {
const question = "Please select a time for your event"
const rows = buildTimeSelectMenu("time");
const filter = i => {
return i.user.id === interaction.user.id;
}
const response = await interaction.editReply({
content: question,
components: rows,
})
const collector = response.createMessageComponentCollector()
collector.on('collect', async i => {
console.log(JSON.stringify(i.values));
i.deferUpdate();
})
}
12 replies