djs-collector
v0.1.2-beta
Published
<div align="center"> <h1>djs-collector</h1> <p> <a href="https://www.npmjs.com/package/djs-collector"><img src="https://img.shields.io/npm/v/djs-collector?maxAge=3600" alt="npm version" /></a> <a href="https://www.npmjs.com/package/djs-c
Downloads
7
Maintainers
Readme
Installation
npm install djs-collector
yarn add djs-collector
Setup ReactionCollector:
const {ReactionCollector} = require("djs-collector");
const client = new Client()//discord.js
client.on("messageCreate" , (message) => {
if(message.content == "help"){
let msg = message.channel.send("help , 1️⃣ 2️⃣ 3️⃣ select one");
let Collector = new ReactionCollector()
.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");
const client = new Client(); //discord.js
client.on("messageCreate", (message) => {
if (message.content == "fast") {
let collector = new MessageCollector()
.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 !!`)
})
}
});