discord.js-confirmation

1.0.5 • Public • Published

discord.js-confirmation


This is a package where you can easily make confirmations


Here's how to do it

const discord = require('discord.js');
const client = new discord.Client();
const confirmation = require('discord.js-confirmation');
client.on('ready', () => console.log(`I am ready to make confirmations!`));

client.on('message', async(message) => {
 if(message.author.bot) return;
 if(message.content.startsWith("!confirmation")) {
	let msg = await message.channel.send('here is your confirmation');
	// first parameter is Message object and is required
	// second parameter is the time when it ends
	let confirmed = await confirmation(msg, 30000);
	if(confirmed === undefined) await message.channel.send(`The timer ran out!`);
	if(confirmed === true) {
		await message.channel.send("I see you selected :white_check_mark: !");
	} else {
		await message.channel.send("I see you selected :x: !");
	}
 }
})

client.login("TOKEN GOES HERE!!!");

Readme

Keywords

none

Package Sidebar

Install

npm i discord.js-confirmation

Weekly Downloads

2

Version

1.0.5

License

ISC

Unpacked Size

2.21 kB

Total Files

3

Last publish

Collaborators

  • atlas_mallusrgreat
  • mallusrgreat