ravenbotv14/commands/untils/passwordgen.js

34 lines
1004 B
JavaScript
Raw Normal View History

2022-09-25 03:16:54 -04:00
const { EmbedBuilder } = require('discord.js');
var generator = require('generate-password');
module.exports = {
name: "password-generator",
description: "Generates a random secure password",
2022-09-28 17:58:24 -04:00
private: true,
2022-09-25 03:16:54 -04:00
options: [{
"name": "length",
"description": "Provide a number for how long to make the password.",
"required": true,
"type": 3 // 6 is type USER
}],
run: async (client, interaction) => {
let length = interaction.options._hoistedOptions[0].value
var password = generator.generate({
length: length,
numbers: true,
symbols: true,
excludeSimilarCharacters: true
});
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("Password Generated!")
.setDescription("Click to reveal: " + "||" + password + "||")
2022-09-25 03:16:54 -04:00
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.editReply({ embeds: [embed] });
},
};