const{ReactionCollector}=require("djs-collector");constclient=newClient()//discord.jsclient.on("messageCreate",(message)=>{if(message.content=="help"){letmsg=message.channel.send("help , 1️⃣ 2️⃣ 3️⃣ select one");letCollector=newReactionCollector().setMessage(msg)//required.setTimeout(10000)/// remove it if you want unlimted time.setFilter((reaction,user)=>user.id==user.id)//reactions already filterd.setBots(false)// false to reactions not working for bots // default false.addReactions(["1️⃣","2️⃣","3️⃣",]).setOnEnd(()=>msg.delete())).start();//to start collect}})
Set up MessageCollector :
const{ MessageCollector }=require("djs-collector");constclient=newClient();//discord.jsclient.on("messageCreate",(message)=>{if(message.content=="fast"){letcollector=newMessageCollector().setChannel(message.channel).setTimeout(10000).setFilter((message)=>message.content=="hi").setBots(false)// false to filterd bot // default false.setOnStart(()=>{message.channel.send("fast is started first one type `hi`");}).setMax(1).start();collector.on("collect",(message)=>{message.channel.send(`<@!${message.author.id}> , you win !!`)})}});