discord-button-pages
v1.1.9
Published
Interactive Discord embed buttons. Allows for pages to be created with Discord embeds in Discord.js v12!
Downloads
338
Maintainers
Readme
Discord-Button-Pages 📖
Interactive Discord embed buttons. Allows for pages to be created with Discord embeds in Discord.js v12!
💖 ~ Support: Fusion Terror's YouTube, Fusion Terror's Patreon
🙋♂ ~ Help: Discord Server
✅ ~ Installation
npm i discord-button-pages
⚙️ ~ Setup
You must have discord-buttons installed in your project. From there you will need to pass in the client constructor from Discord.js into Discord--Buttons as shown below:
const Discord = require('discord.js'); //Requiring Discord.js module.
const client = new Discord.Client(); //Creating and assigning the Discord.js Client constructor.
const DiscordButtons = require('discord-buttons');
DiscordButtons(client);
📝 ~ Features
- Interactive buttons.
- Swap between embeds quickly and effortlessly.
- Customizable button emojis.
- Discord.js 12 Support
- Discord Server Support
💡 ~ Example
const Discord = require('discord.js'); //Requiring Discord.js module.
const client = new Discord.Client(); //Creating and assigning the Discord.js Client constructor.
client.interaction = {}; //Creating interaction object
const DiscordButtons = require('discord-buttons'); //Requiring Discord-BUttons module.
const ButtonPages = require('discord-button-pages'); //Requiring Discord-Button-Pages module.
DiscordButtons(client);
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('clickButton', (button) => {
ButtonPages.buttonInteractions(button, client.interaction);
});
client.on('message', msg => {
if (msg.content === '!test') {
const embed1 = new Discord.MessageEmbed()
.setTitle('Embed #1')
.setColor('RED');
const embed2 = new Discord.MessageEmbed()
.setTitle('Embed #2')
.setColor('YELLOW');
const embed3 = new Discord.MessageEmbed()
.setTitle('Embed #3')
.setColor('BLUE');
const embedPages = [embed1, embed2, embed3];
ButtonPages.createPages(client.interaction, msg, embedPages, 60 * 1000, "red", "👉", "👈", "❌");
}
});