GithubHelp home page GithubHelp logo

icoltz / discord-fetch-all Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 4.0 69 KB

Simple utility allowing a quick way to fetch all reactions from a message or fetch all messages from a channel. Written in TypeScript compiled into JavaScript.

License: MIT License

TypeScript 54.21% JavaScript 45.79%
discord fetch reactions messages

discord-fetch-all's Introduction

npm install info

Discord server NPM version NPM downloads

About

discord-fetch-all is an easy way to fetch all messages from a channel or all reactions from a message.

Usage

How to fetch all messages from a channel.

const fetchAll = require('discord-fetch-all');

// First parameter needs to be a discord.js channel object
// Second parameter is a optional set of options.
const allMessages = await fetchAll.messages(channel, {
	reverseArray: true, // Reverse the returned array
	userOnly: true, // Only return messages by users
	botOnly: false, // Only return messages by bots
	pinnedOnly: false, // Only returned pinned messages
});

// Will return an array of all messages in the channel
// If the channel has no messages it will return an empty array
console.log(allMessages);

How to fetch all users that have reacted to a message.

const fetchAll = require('discord-fetch-all');

// First parameter needs to be a discord.js message object
// Second parameter is a optional set of options.
const allMessages = await fetchAll.reactions(message, {
	userOnly: false, // Only return users that have reacted to the message
	botOnly: true, // Only return bots that have reacted to the message
});

// Will return an array of all users that have reacted
// If not users have reacted it will return an empty array
console.log(allMessages);

Links

Help

If you don't understand something in the documentation, you are experiencing problems, don't hesitate to join our Discord Server to seek for some help.

discord-fetch-all's People

Contributors

icoltz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.