🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

discord-buttons-react

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-buttons-react

A package which allow you to use buttons as reactions

0.0.4
latest
npm
Version published
Weekly downloads
297
2021.43%
Maintainers
1
Weekly downloads
 
Created
Source

discord-buttons-react Gif example


discord-buttons-react is a package that allow you to use buttons as reactions.

BETA ! there's probably some bugs !


Install

npm install discord-buttons-react

Setup

const discord = require('discord.js');
const client = new discord.Client();
require('discord-buttons')(client); // must be below your discord.Client()
require('discord-buttons-react')(client); // must be below your discord.Client()

You absolutly need to require both discord-buttons and discord-buttons-react !


Method

message.channel.createMessageReactionButton(content, ButtonsReactionArray);

Example

const disbutreact = require("discord-buttons-react");

const embed = new Discord.MessageEmbed().setColor("BLURPLE").setDescription("Click to add reaction !")

const ReactionButton1 = new disbutreact.ReactionButton()
    .setStyle('red')
    .setEmoji('✨');

const ReactionButton2 = new disbutreact.ReactionButton()
    .setStyle('green')
    .setEmoji('🎉');

message.channel.createMessageReactionButton("test", [ReactionButton1, ReactionButton2]);
// or
message.channel.createMessageReactionButton(embed, [ReactionButton1, ReactionButton2]);
  • You can put max 25 ReactionButtons.
  • If you don't precise any style, it will be "grey". You can't use url style.

New Events

messageButtonReactionAdd

client.on("messageButtonReactionAdd", reactionButton => {
    // your code
})

messageButtonReactionRemove

client.on("messageButtonReactionRemove", reactionButton => {
    // your code
})

Both events return reactionButton object :

methodsresult
clicker.user / .member
reactionEmojiemoji name or id
messagemessage object

Contact

Discord

Keywords

discord

FAQs

Package last updated on 04 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts