New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

elara-react

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elara-react

Elara's reaction handler, for embed-pages and embed-menus


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created

Getting Started

RichDisplay

const { RichDisplay } = require("elara-react"),
      { MessageEmbed } = require("discord.js");

const menu = new RichDisplay(new MessageEmbed())

menu.addPage(embed => {
    embed.setTitle(`Title!`)
    return embed;
});

menu.run(await message.channel.send(`Loading, one moment please!`), { filter: (react, user) => user.id === message.author.id })

// Only include 
// , { filter: (react, user) => user.id === message.author.id }
// If you want it to be locked to the message author. 

RichMenu

const { RichMenu } = require("elara-react"),
      { MessageEmbed } = require("discord.js");

const menu = new RichMenu(new MessageEmbed())

menu.addOption(`Option 1`, `Description for the option`);
// Up to 10 options.

let msg = await message.channel.send(`Loading, one moment please.`),
    collector = await menu.run(msg, { filter: (react, user) => user.id === message.author.id }),
    choice = await collector.selection;
if(choice === null || choice === undefined) return msg.edit(`You didn't provide a choice?`);

// returns a number.
// 0-9
if(choice === 1) return msg.edit(`You've selected option 1!`); 
// Only include 
// , { filter: (react, user) => user.id === message.author.id }
// If you want it to be locked to the message author. 

FAQs

Package last updated on 14 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts