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 toolkit6mo 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!
TMGHavoc
TMGHavoc6mo ago
20.10.0 for node -v discord.js@14.14.1
No description
TMGHavoc
TMGHavoc6mo 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
Squid6mo 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
TMGHavoc
TMGHavoc6mo 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
Squid6mo ago
that is a completely different error than Unknown Webhook
TMGHavoc
TMGHavoc6mo ago
It was my origional error Thats what its showing now
Squid
Squid6mo ago
reply is neither a Message nor TextBasedChannel instance
TMGHavoc
TMGHavoc6mo ago
I have it to a variable that awaits interaction.fetchReply
Squid
Squid6mo ago
you misspelled component as componenet
TMGHavoc
TMGHavoc6mo 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
Squid6mo ago
Is this the exact line of code on index.js line 411?
TMGHavoc
TMGHavoc6mo 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
Squid6mo ago
You need to resolve the Promise with await
TMGHavoc
TMGHavoc6mo ago
So should I add that to
inrteraction.reply()
inrteraction.reply()
Squid
Squid6mo 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
TMGHavoc
TMGHavoc6mo 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
Squid6mo 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
SightedHavoc6mo ago
Tyyyy
Want results from more Discord servers?
Add your server
More Posts