Message Component Collector Issue
msg.awaitMessageComponent({
filter: (i) => i.user.id === interaction.user.id,
componentType: ComponentType.Button,
time: 60000,
})
.then(async (i) => {
console.log(2);
})
msg.awaitMessageComponent({
filter: (i) => i.user.id === interaction.user.id,
componentType: ComponentType.Button,
time: 60000,
})
.then(async (i) => {
console.log(2);
})
Unhandled Rejection at: Promise Promise {
<rejected> Error: InteractionCollectorError
at InteractionCollector.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\InteractionResponse.js:37:21)
at Object.onceWrapper (node:events:628:26)
at InteractionCollector.emit (node:events:525:35)
at InteractionCollector.emit (node:domain:489:12)
at InteractionCollector.stop (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:218:10)
at Timeout.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:96:61)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
Unhandled Rejection at: Promise Promise {
<rejected> Error: InteractionCollectorError
at InteractionCollector.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\InteractionResponse.js:37:21)
at Object.onceWrapper (node:events:628:26)
at InteractionCollector.emit (node:events:525:35)
at InteractionCollector.emit (node:domain:489:12)
at InteractionCollector.stop (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:218:10)
at Timeout.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:96:61)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
3 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Can you put a catch on it too and log that
Error: InteractionCollectorError
at InteractionCollector.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\InteractionResponse.js:37:21)
at Object.onceWrapper (node:events:628:26)
at InteractionCollector.emit (node:events:525:35)
at InteractionCollector.emit (node:domain:489:12)
at InteractionCollector.stop (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:218:10)
at Timeout.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:96:61)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
Error: InteractionCollectorError
at InteractionCollector.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\InteractionResponse.js:37:21)
at Object.onceWrapper (node:events:628:26)
at InteractionCollector.emit (node:events:525:35)
at InteractionCollector.emit (node:domain:489:12)
at InteractionCollector.stop (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:218:10)
at Timeout.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:96:61)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
interaction.showModal(newUserModal);
interaction
.awaitModalSubmit({ time: 180000 })
.then(async (modal) => {
let name = modal.fields.getTextInputValue("name");
let email = modal.fields.getTextInputValue("email");
console.log(name, email);
modal
.reply({
embeds: [
new EmbedBuilder()
.setTitle("Verification Process")
.setAuthor({
name: `${interaction.user.username}#${interaction.user.discriminator}`,
iconURL:
interaction.user.displayAvatarURL(),
})
.setDescription(
`Please confirm the following information is correct.`
)
.setColor("#2f3136")
.addFields([
{
name: "Name/Nickname",
value: `||${name}||`,
inline: true,
},
{
name: "Email",
value: `||${email}||`,
inline: true,
},
])
.setImage(
"https://i.imgur.com/gLT4grB.png"
),
],
components: [correctOrIncorrect],
ephemeral: true,
})
.then((msg) => {
console.log(msg);
msg.awaitMessageComponent({
filter: (i) =>
i.user.id === interaction.user.id,
componentType: ComponentType.Button,
time: 60000,
})
.then(async (i) => {
console.log(2);
interaction.showModal(newUserModal);
interaction
.awaitModalSubmit({ time: 180000 })
.then(async (modal) => {
let name = modal.fields.getTextInputValue("name");
let email = modal.fields.getTextInputValue("email");
console.log(name, email);
modal
.reply({
embeds: [
new EmbedBuilder()
.setTitle("Verification Process")
.setAuthor({
name: `${interaction.user.username}#${interaction.user.discriminator}`,
iconURL:
interaction.user.displayAvatarURL(),
})
.setDescription(
`Please confirm the following information is correct.`
)
.setColor("#2f3136")
.addFields([
{
name: "Name/Nickname",
value: `||${name}||`,
inline: true,
},
{
name: "Email",
value: `||${email}||`,
inline: true,
},
])
.setImage(
"https://i.imgur.com/gLT4grB.png"
),
],
components: [correctOrIncorrect],
ephemeral: true,
})
.then((msg) => {
console.log(msg);
msg.awaitMessageComponent({
filter: (i) =>
i.user.id === interaction.user.id,
componentType: ComponentType.Button,
time: 60000,
})
.then(async (i) => {
console.log(2);