1.0.6 • Published 3 years ago

djs-password v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Djs-Password

NPM

js-standard-style

 

Installation

npm i djs-password

 

Setup

//require the djs-password module
const password = require('djs-password');

//call the password generator
password.genPassword(message, <Number>)

Example (djs v13)

const discord = require('discord.js');
const password = require('djs-password');

const client = new discord.Client({
  intents: 32767,
});

let prefix = '!';
let token = 'bot token goes here!';

client.on('ready', () => {
	console.log(`${client.user.tag} is ready!`);
});

client.on('messageCreate', async(message) => {
  if (!message.content.startsWith(prefix) || message.author.bot) 
    return;

  const args = message.content.slice(prefix.length).trim().split(/ +/);
	const command = args.shift().toLowerCase();

  if(command === 'password') {
    try {
    if(args[0] > 256)
      return message.channel.send({ content: "Max limit hit" });
    password.genPassword(message, args[0]);
    } catch (e) {
      message.channel.send(e)
    }
  } else if(command === 'ping') {
    message.channel.send({ content: `${client.ws.ping}ms!` })
  }

})

client.login(token)

If you have any questions, be welcome to message me on Discord.

The_Iron_Golm#5615

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago