npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

discord-collector

v1.11.18

Published

Library to easily create message collector and reactions on discord, with customization ways

Downloads

388

Readme

PLEASE READ

THE FOLLOWING CODE IS BY THIS GUY, AND ALL CREDIT GOES TO HIM, I HAVE JUST TWEAKED SOME STUFF.

downloads-npm-total downloads-npm-week dependencies-deprecated-status npm-version

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.

Reaction Role Gif

You can find this code example here


Reaction menu

To create a reaction menu with multiple pages.

Menu Gif

You can find this code example here

Simple reaction collector

To use in multiple actions, react and then trigger one function to do things.

Question Gif

Simple boolean reaction collector

To use in if statements, the asynchronous reaction collector returning Promise is more practical

Question Gif

Embeds pagination

Example here

Easier paginator embeds, with back/skip reaction to change current page.

Question Gif

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

Question Gif

Async message collector

Await for message from user, and when user send, will return user message as Promise.

Question Gif

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!");
}