Creating multiple selects command
Hi, i'm currently trying to create a command which utilizes select function, i want to collect 2-3 values one after another but when i try to send new select using .editReply it keeps loading and throws interaction failed, video attached, code below
async execute(interaction) {
const ChannelSelect = new ActionRowBuilder()
.addComponents(
new ChannelSelectMenuBuilder()
.setCustomId('verifychannel')
.setPlaceholder('Select channel')
);
const RoleSelect = new ActionRowBuilder()
.addComponents(
new RoleSelectMenuBuilder()
.setCustomId('verifiedrole')
.setPlaceholder('Select role')
);
await interaction.reply({
content: 'Plase select verify channel!',
components: [ChannelSelect],
ephemeral: true
});
const ChannelCollector = interaction.channel.createMessageComponentCollector({
componentType: ComponentType.ChannelSelect,
time: 15000
});
ChannelCollector.on('collect', async (i) => {
if (i.user.id === interaction.user.id) {
if (i.customId === 'verifychannel') {
channel = i.channels.first();
await interaction.editReply({
content: 'Plase specified verified role!',
components: [RoleSelect]
});
}
} else {
i.reply({
content: `This select menu isn't for you!`,
ephemeral: true
});
}
});
const RoleCollector = interaction.channel.createMessageComponentCollector({
componentType: ComponentType.RoleSelect,
time: 15000
});
RoleCollector.on('collect', async (i) => {
if (i.user.id === interaction.user.id) {
if (i.customId === 'verifiedrole') {
if (channel) {
await interaction.editReply({
content: `Data collected, creating verify button in #${channel.name}!`,
components: []
});
} else {
await interaction.editReply({
content: `Channel wasn't specified, exiting creator.`,
components: []
});
}
}
} else {
i.reply({
content: `This select menu isn't for you!`,
ephemeral: true
});
}
});async execute(interaction) {
const ChannelSelect = new ActionRowBuilder()
.addComponents(
new ChannelSelectMenuBuilder()
.setCustomId('verifychannel')
.setPlaceholder('Select channel')
);
const RoleSelect = new ActionRowBuilder()
.addComponents(
new RoleSelectMenuBuilder()
.setCustomId('verifiedrole')
.setPlaceholder('Select role')
);
await interaction.reply({
content: 'Plase select verify channel!',
components: [ChannelSelect],
ephemeral: true
});
const ChannelCollector = interaction.channel.createMessageComponentCollector({
componentType: ComponentType.ChannelSelect,
time: 15000
});
ChannelCollector.on('collect', async (i) => {
if (i.user.id === interaction.user.id) {
if (i.customId === 'verifychannel') {
channel = i.channels.first();
await interaction.editReply({
content: 'Plase specified verified role!',
components: [RoleSelect]
});
}
} else {
i.reply({
content: `This select menu isn't for you!`,
ephemeral: true
});
}
});
const RoleCollector = interaction.channel.createMessageComponentCollector({
componentType: ComponentType.RoleSelect,
time: 15000
});
RoleCollector.on('collect', async (i) => {
if (i.user.id === interaction.user.id) {
if (i.customId === 'verifiedrole') {
if (channel) {
await interaction.editReply({
content: `Data collected, creating verify button in #${channel.name}!`,
components: []
});
} else {
await interaction.editReply({
content: `Channel wasn't specified, exiting creator.`,
components: []
});
}
}
} else {
i.reply({
content: `This select menu isn't for you!`,
ephemeral: true
});
}
});