Message Specific Collector

So I have a embed with buttons which acts as a panel to control a voice channel. There can be multiple of these panels for multiple voice channels. Right now every panel generated can be used interchangeably. How would I differentiate each panel with each voice channel so that only the generated voice panel/specific panel can be used to interact with the voice channel. Here my current code for the collector:
const sendEmbed = await panelLog.send({ embeds: [panelEmbed], components: [row], fetchReply: true })
const filter = i => ['lock', 'unlock', 'comeplay', 'edit-name', 'stage', 'end-stage', 'ban', 'finish', 'editNameModal'].includes(i.customId);
const collector = sendEmbed.createMessageComponentCollector({ filter, time: null });
const sendEmbed = await panelLog.send({ embeds: [panelEmbed], components: [row], fetchReply: true })
const filter = i => ['lock', 'unlock', 'comeplay', 'edit-name', 'stage', 'end-stage', 'ban', 'finish', 'editNameModal'].includes(i.customId);
const collector = sendEmbed.createMessageComponentCollector({ filter, time: null });
"discord.js": "^14.11.0"
3 Replies
d.js toolkit
d.js toolkit17mo ago
- 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.
treble/luna
treble/luna17mo ago
you can try passing in the id of the channel in the customid of the buttons
victorr
victorrOP17mo ago
That should work, I'll lyk how it goes. Thanks.
Want results from more Discord servers?
Add your server