discord-message-buttons
v1.0.0
Published
A npm package for creating interactive buttons under messages or embeds in Discord using discord.js.
Downloads
1
Maintainers
Readme
# discord-interactions
[![npm version](https://badge.fury.io/js/discord-interactions.svg)](https://www.npmjs.com/package/discord-interactions)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/your-username/discord-interactions/blob/main/LICENSE)
discord-interactions is an npm package that provides a simple and straightforward way to create interactive buttons under messages or embeds in Discord using the discord.js library.
## Installation
```bash
npm install discord-interactions
Usage
Here's an example of how to use discord-interactions to create a button:
const Discord = require('discord.js');
const client = new Discord.Client();
const { createButton } = require('discord-interactions');
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});
client.on('message', (message) => {
if (message.content === '!button') {
createButton(message, 'Click me!', 'PRIMARY', 'buttonId', (interaction) => {
interaction.reply({ content: 'Button clicked!' });
});
}
});
client.login('YOUR_DISCORD_BOT_TOKEN');
Replace 'YOUR_DISCORD_BOT_TOKEN'
with your actual Discord bot token.
Contributing
Contributions are welcome! Please check out the Contribution Guidelines for more details.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
Make sure to replace `'YOUR_DISCORD_BOT_TOKEN'` with your actual Discord bot token.
Feel free to customize the content and structure of the `README.md` file to best fit your package.