I have the following code which is contained within a much larger if statement block:
message.reply({ embeds: [multipleUsersEmbedFunction("Multiple Users Found", `The following users were found:\n${string}`, members)], components: [actionRow] }).then((embedMessage) => {
const collector = embedMessage.createMessageComponentCollector({ time: 5000 });
collector.on("collect", async (i) => {
console.log(i);
return members[Number(i.customId)];
});
});
At the bottom of my code I have the following:
return undefined;
, which is used by other if else statements which do not return anything.
However, this message collector (discord.js) of course should wait 5 seconds before returning undefined, however my code is still instantly returning undefined.
How would I circumvent this?