1.0.5 • Published 3 years ago
dm-reaction-menu v1.0.5
Installation
npm i dm-reaction-menu
Project Summary
Create flexible, understandable and performant Discord reaction menus with ease. This package is an addon for Discord.js that automates all aspects of a reaction-based navigation menu.
This reaction menu will be sent in authors DM
Besides creating it, of course. It'd be pretty useless if you couldn't create the menus yourself.
Learn Discord.js-Menu in Y minutes.
Here's a fast, fully-featured demo of Discord.js-menu. With one read-through of this demo, you should have all you need to create your own menus from scratch.
All values have TypeScript / TSDoc types, so if you use an editor like VSCode, you should get real-time code suggestions and tooltips where appropriate.
/* Import all the usual stuff. This shouldn't be anything new. */
const { Client, MessageEmbed } = require('discord.js')
const rm = require("dm-reaction-menu");
const client = new Client()
/* Run this code every time a new message is sent. */
client.on('message', message => {
if(message.content == '!test') {
// rm.reactions.back = '👈'
// rm.reactions.next = '👉'
new rm.menu({
channel: message.author, // or message.channel, if you want it to be sent in the channel not DM
userID: message.author.id,
pages: [
new MessageEmbed({ title:'test' }),
new MessageEmbed({ title:'test2' }),
new MessageEmbed({ title:'test3' }),
new MessageEmbed({ title:'test4' }),
new MessageEmbed({ title:'test5' })
]
})
}
});
client.login("Get your bot's oauth token at https://discord.com/developers/applications")