djs-confirmation

1.0.0 • Public • Published

djs-confirmations

Confirmations with reactions or buttons in an easy way.

Requirements

  • Discord.js V13.1.0 (Will be changed overtime)
  • Node.js v16.6.1+ (Discord.js Requirement)

Defining

Using Node.js require()

const confirmation = require("djs-confirmations");

Using ES6 imports

import confirmation from "djs-confirmations";

Button Confirmation

////// MAKE SURE YOU DEFINED THE PACKAGE
const Discord = require("discord.js");
const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] });

client.on("ready", () => console.log(`I am ready to make cool button confirmations.`));

client.on("message", message => {
  if (message.author.bot) return;
  if (message.content == "confirm") {
    const returned = new confirmation.ButtonConfirmation(
      message.channel /*channel to send the message*/,
      messageOptions /*message's options (MessageOptions)*/,
      message.author.id /*User to click the button*/,
    ).start();
    let interaction = returned[1];
    if (returned[0]) {
      interaction.reply("You selected true");
    } else {
      interaction.reply("You selected false");
    }
  }
});

client.login("super secret token");

Reaction Confirmation

Find em out with the typings or just check the internal codes at https://npm.runkit.com/djs-confirmations I'll do this later bye :D

Readme

Keywords

none

Package Sidebar

Install

npm i djs-confirmation

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

6.76 kB

Total Files

15

Last publish

Collaborators

  • atlas_mallusrgreat
  • mallusrgreat