#MessageComponentCollectorSearchCommand
1 messages · Page 1 of 1 (latest)
cause creating a messageComponentCollector like this interaction.createMessageComponentCollector({}) it says its not a function, obviously
so im trying to assign the last edited message to a variable like:
var tempmsg = interaction.editReply({})
and then it does not work either?
idk
Could I see the code for your collector?
const filter2 = (interaction) => interaction.customId === 'button';
const collector = context.createMessageComponentCollector({
filter2,
time: 30000
})
collector.on('collect', async button => {})
Still trying something with filter cause its my first time creating a collector like this :)
and i got it with the editing part. i was dumb.
const collector = context.createMessageComponentCollector({ componentType: 'BUTTON', time: 30000 });
I think that is what you'll need to do to create the collector
so no filter needed? cause i dont know what to filter for xd
You'd probably want to use a filter to make sure that the collector is only listening for the user who created the interaction
But since it's ephemeral you should be fine
Yeah
Then you can do something like this to listen to what's collected
collector.on('collect', i => {
// your code here
});```
How come you have collector.stop() and button.deferUpdate()?
the switch case looks fine though
does collector.stop not work?
Assuming you've given your buttons the id's of 1 through 5
collector.stop() will stop the collection
i think collector.stop is fine not?
Yes its what i want
and then i can use
collector.on('end', i => {
// your code here
});
i saw from somebody the button.defer thing
so idk if its even supposed to be there lmao
tried console.logging each case and it works
That seems promising
Hopefully you should be able to use interaction.editReply() to edit the original response based on the buttons pressed now
does a collector need to be stopped at some point?