New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
4
decreased by-50%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc