Discord JS Reaction Collector
A simple package to use discord.js v12
reaction collectors.
Important Links
Install
First install the package
npm i djs-reaction-collector
Importing
// Using discord.js
const collector = require('djs-reaction-collector');
// Using typescript
import collector from "djs-reaction-collector";
Examples
const { pagination } = require('djs-reaction-collector')
const Discord = require('discord.js');
const lol = new Discord.MessageEmbed();
pages = [
lol,
lmao
];
pagination(message, pages, emojiList, timeout);
Confirm
const { confirm } = require("djs-reaction-collector")
message.channel.send("Do you want to send the message?").then(async (message) => {
const reactions = await confirm(message, message.author, ["✅", "❌"], 10000);
if(reactions === "✅") {
message.channel.send("Hello All")
}
if(reactions === "❌") {
return;
}
else {
console.log("Timed Out")
}
})
Delete Timeout
const { deletetimeout } = require("djs-reaction-collector")
const deletion = await message.channel.send("DJS REACTION COLLECTOR");
deletetimeout(message, deletion, 5000)