discord-buttons-react
v0.0.4
Published
A package which allow you to use buttons as reactions
Downloads
17
Maintainers
Readme
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 :
| methods | result | |---|---| | clicker | .user / .member | | reactionEmoji | emoji name or id | | message | message object |