Discord Error Code 10015 when using a collector to handle button events

Hello! I am working on a bot Im on the development team with and I dont know how to fix this issue. It is showing a "Unknown Webhook" error and Im not even mentioning a webhook. Im just using embeds and buttons. Does anyone know the answer to this?
19 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Havoc
HavocOP12mo ago
20.10.0 for node -v [email protected]
No description
Havoc
HavocOP12mo ago
const reply = await interaction.fetchReply()

const filter = (i) => i.user.id === interaction.user.id

const collector = reply.createMessageComponentCollector({
componentType: ComponentType.Button,
filter,
time: 60000
});
const reply = await interaction.fetchReply()

const filter = (i) => i.user.id === interaction.user.id

const collector = reply.createMessageComponentCollector({
componentType: ComponentType.Button,
filter,
time: 60000
});
Squid
Squid12mo ago
Interactions are webhook-based internally Use your stack trace to figure out which specific line of code is throwing the error e.g., if it's fetchReply(), then it's likely that you have yet to reply to the interaction so there's nothing to fetch
Havoc
HavocOP12mo ago
Could I possibly get a code snippet? I have put await from interaction.fetchReply() to interaction.reply(...) and it still isnt working I can’t right now will in a little
node:events:492
throw er; // Unhandled 'error' event
^

TypeError: reply.createMessageComponenetCollector is not a function
at Client.<anonymous> (/home/runner/Universal/index.js:411:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:397:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

Node.js v20.10.0
node:events:492
throw er; // Unhandled 'error' event
^

TypeError: reply.createMessageComponenetCollector is not a function
at Client.<anonymous> (/home/runner/Universal/index.js:411:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:397:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

Node.js v20.10.0
@Qjuh
Squid
Squid12mo ago
that is a completely different error than Unknown Webhook
Havoc
HavocOP12mo ago
It was my origional error Thats what its showing now
Squid
Squid12mo ago
reply is neither a Message nor TextBasedChannel instance
Havoc
HavocOP12mo ago
I have it to a variable that awaits interaction.fetchReply
Squid
Squid12mo ago
you misspelled component as componenet
Havoc
HavocOP12mo ago
I have a variable
const reply = await interaction.fetchReply()
const reply = await interaction.fetchReply()
Thx one sec
node:events:492
throw er; // Unhandled 'error' event
^

TypeError: reply.createMessageComponentCollector is not a function
at Client.<anonymous> (/home/runner/Universal/index.js:411:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:397:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

Node.js v20.10.0
node:events:492
throw er; // Unhandled 'error' event
^

TypeError: reply.createMessageComponentCollector is not a function
at Client.<anonymous> (/home/runner/Universal/index.js:411:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:397:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

Node.js v20.10.0
@Squid Still not working
Squid
Squid12mo ago
Is this the exact line of code on index.js line 411?
Havoc
HavocOP12mo ago
const collector = reply.createMessageComponentCollector({
componentType: ComponentType.Button,
filter,
time: 15000
})
const collector = reply.createMessageComponentCollector({
componentType: ComponentType.Button,
filter,
time: 15000
})
411 through 414
const reply = interaction.fetchReply()
const reply = interaction.fetchReply()
Mb Wrong lines
Squid
Squid12mo ago
You need to resolve the Promise with await
Havoc
HavocOP12mo ago
So should I add that to
inrteraction.reply()
inrteraction.reply()
Squid
Squid12mo ago
You should add it to essentially every function that returns a Promise especially if you assign a variable to a Promise's resolved return value
Havoc
HavocOP12mo ago
const rawreply = await interaction.reply({ embeds: [buttomEmbed], components: [row], fetchReply: true })
const filter = (i) => i.user.id === interaction.user.id
const reply = interaction.fetchReply()


const collector = reply.createMessageComponentCollector({
componentType: ComponentType.Button,
filter,
time: 15000
})

collector.on('collect', async (interaction) => {
console.log('Button Clicked')
})
const rawreply = await interaction.reply({ embeds: [buttomEmbed], components: [row], fetchReply: true })
const filter = (i) => i.user.id === interaction.user.id
const reply = interaction.fetchReply()


const collector = reply.createMessageComponentCollector({
componentType: ComponentType.Button,
filter,
time: 15000
})

collector.on('collect', async (interaction) => {
console.log('Button Clicked')
})
@Squid This is the whole line of code
Squid
Squid12mo ago
Hi Also you have defined your reply twice There's no need to fetch the reply when you already have the reply saved in a variable
SightedHavoc
SightedHavoc12mo ago
Tyyyy
Want results from more Discord servers?
Add your server