# discord-buttons-react

> A package which allow you to use buttons as reactions

Latest version **0.0.4** (published 2021-06-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install discord-buttons-react
pnpm add discord-buttons-react
yarn add discord-buttons-react
bun add discord-buttons-react
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2021-06-04 |
| First published | 2021-06-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 25 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | gaetan20 |
| Maintainers | gaetan20 |
| Keywords | discord, discord-buttons, gaetan20, reaction, react |

## Links

- npm: https://www.npmjs.com/package/discord-buttons-react
- npm.io page: https://npm.io/package/discord-buttons-react

## Dependencies (2)

- [quick.db](https://npm.io/package/quick.db.md) ^7.1.3
- [discord-buttons](https://npm.io/package/discord-buttons.md) ^3.0.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2021-06-04
- 0.0.3 — 2021-06-04
- 0.0.2 — 2021-06-03
- 0.0.1 — 2021-06-03

## README

<div align="center">
  <p>
    <img src="https://gist.githubusercontent.com/gaetan20/b55932177fe4c41775acebc40f9d3dcc/raw/65533e199858dd2d6cd5dc7a820f57108baf95fa/discord-buttons-react.svg" alt="discord-buttons-react" />
     <a href="url"><img src="https://s6.gifyu.com/images/ezgif-2-723bd5d0c7d0.gif" style="border-radius: 10px 10px 10px 10px;" alt="Gif example"></a>
  </p>
  <br>
</div>

discord-buttons-react is a package that allow you to use buttons as reactions.

### BETA ! there's probably some bugs !

<br>

## Install
```sh
npm install discord-buttons-react
```
## Setup
```js
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 !

<br />

## Method
```js
message.channel.createMessageReactionButton(content, ButtonsReactionArray);
```

## Example
```js
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
```js
client.on("messageButtonReactionAdd", reactionButton => {
    // your code
})
```
### messageButtonReactionRemove
```js
client.on("messageButtonReactionRemove", reactionButton => {
    // your code
})
```

Both events return reactionButton object :

| methods | result |
|---|---|
| clicker | .user / .member |
| reactionEmoji | emoji name or id |
| message | message object |

<br />

## Contact

[Discord](https://discord.gg/f7FdjUnvFX)

---
_Source: https://npm.io/package/discord-buttons-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
