2022-09-25 03:16:54 -04:00
|
|
|
const { EmbedBuilder } = require('discord.js');
|
|
|
|
var generator = require('generate-password');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: "password-generator",
|
2022-09-28 14:48:15 -04:00
|
|
|
private: true,
|
2022-09-25 03:16:54 -04:00
|
|
|
description: "Generates a random secure password",
|
|
|
|
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!")
|
2022-09-28 14:48:15 -04:00
|
|
|
.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] });
|
|
|
|
},
|
|
|
|
};
|