discord-collector
v1.11.18
Published
Library to easily create message collector and reactions on discord, with customization ways
Downloads
388
Maintainers
Readme
PLEASE READ
THE FOLLOWING CODE IS BY THIS GUY, AND ALL CREDIT GOES TO HIM, I HAVE JUST TWEAKED SOME STUFF.
Discord-collector
Library to easily create message collector, reactions collector and reactions role on discord.js v13, with customization ways.
Thank you for using discord-collector! ❤
Summary
◘ Reactions Collectors:
| Reaction Role
| Menu
| Question
| Yes/No Question
| Embeds Paginator
◘ Messages Collectors:
| Question
| Async Question
◘ Examples
| Reaction Role Manager
| Reaction Menu
◘ Others
| Changelog
| Breaking Changes
Discord Server
Sorry, but support server was closed for no longer support of this lib
Documentation
See all documentation of last version here
Reaction role
You can create reactions roles, with amazing functions:
| • If you bot turns off, when it turns on all users reacted in messages will win the role.
| • If you bot turns off, if any user remove reaction, when the bot turns on will remove the role from him.
| • You can store the roles in a JSON file and migrate the reaction role data.
| • You can limit max roles given by bot, like 10 roles.
| • Toggled roles: Limit one of these roles to use (Util for colors reaction roles, only get one of roles)
| • Requirements: Limit roles to only boosters or discord developers win roles!
| • Just Win: you can configure a role to just give to member if him react on it!
| • Just Lose: you can configure a role to just take from member if him react on it!
| • Reversed: When react on it, member will lose the role. When take off reaction of it, member will win the role.
You can find this code example here
Reaction menu
To create a reaction menu with multiple pages.
You can find this code example here
Simple reaction collector
To use in multiple actions, react and then trigger one function to do things.
Simple boolean reaction collector
To use in if
statements, the asynchronous reaction collector returning Promise is more practical
Embeds pagination
Example here
Easier paginator embeds, with back/skip reaction to change current page.
You can find this code example here
Simple messages collector
Await for messages from user, and when it's send will fire a trigger to do things. See exemple [here]
You can find this code example here
Async message collector
Await for message from user, and when user send, will return user message as Promise.
const { MessageCollector } = require("discord.js-collector");
const botMessage = await message.channel.send("Awaiting a message");
const userMessage = await MessageCollector.asyncQuestion({
botMessage,
user: message.author.id,
});
if (userMessage.content === "ping") {
await message.channel.send("pong!");
}