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);
require('discord-buttons-react')(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]);
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 => {
})
messageButtonReactionRemove
client.on("messageButtonReactionRemove", reactionButton => {
})
Both events return reactionButton object :
methods | result |
---|
clicker | .user / .member |
reactionEmoji | emoji name or id |
message | message object |
Contact
Discord