Adding Password Generator
This commit is contained in:
parent
4e74661aa5
commit
0801137b9c
32
commands/untils/passwordgen.js
Normal file
32
commands/untils/passwordgen.js
Normal file
@ -0,0 +1,32 @@
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
var generator = require('generate-password');
|
||||
|
||||
module.exports = {
|
||||
name: "password-generator",
|
||||
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!")
|
||||
.setDescription(password)
|
||||
.setTimestamp()
|
||||
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
|
||||
interaction.editReply({ embeds: [embed] });
|
||||
},
|
||||
};
|
11
package-lock.json
generated
11
package-lock.json
generated
@ -13,6 +13,7 @@
|
||||
"discord.js": "^14.0.3",
|
||||
"dotenv": "^16.0.0",
|
||||
"download-file": "^0.1.5",
|
||||
"generate-password": "^1.7.0",
|
||||
"give-me-a-joke": "^0.5.1",
|
||||
"glob": "^7.2.0",
|
||||
"is-not-defined": "^1.0.1",
|
||||
@ -615,6 +616,11 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/generate-password": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/generate-password/-/generate-password-1.7.0.tgz",
|
||||
"integrity": "sha512-WPCtlfy0jexf7W5IbwxGUgpIDvsZIohbI2DAq2Q6TSlKKis+G4GT9sxvPxrZUGL8kP6WUXMWNqYnxY6DDKAdFA=="
|
||||
},
|
||||
"node_modules/getpass": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
|
||||
@ -1975,6 +1981,11 @@
|
||||
"wide-align": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"generate-password": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/generate-password/-/generate-password-1.7.0.tgz",
|
||||
"integrity": "sha512-WPCtlfy0jexf7W5IbwxGUgpIDvsZIohbI2DAq2Q6TSlKKis+G4GT9sxvPxrZUGL8kP6WUXMWNqYnxY6DDKAdFA=="
|
||||
},
|
||||
"getpass": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
|
||||
|
@ -14,6 +14,7 @@
|
||||
"discord.js": "^14.0.3",
|
||||
"dotenv": "^16.0.0",
|
||||
"download-file": "^0.1.5",
|
||||
"generate-password": "^1.7.0",
|
||||
"give-me-a-joke": "^0.5.1",
|
||||
"glob": "^7.2.0",
|
||||
"is-not-defined": "^1.0.1",
|
||||
|
Loading…
Reference in New Issue
Block a user