Added ephemeral responses for the pasword generator
This commit is contained in:
parent
7b8a015825
commit
398de1365c
@ -3,6 +3,7 @@ var generator = require('generate-password');
|
||||
|
||||
module.exports = {
|
||||
name: "password-generator",
|
||||
private: true,
|
||||
description: "Generates a random secure password",
|
||||
options: [{
|
||||
"name": "length",
|
||||
@ -24,7 +25,7 @@ module.exports = {
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor("#FF0000")
|
||||
.setTitle("Password Generated!")
|
||||
.setDescription(password)
|
||||
.setDescription("Click to reveal: " + "||" + password + "||")
|
||||
.setTimestamp()
|
||||
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
|
||||
interaction.editReply({ embeds: [embed] });
|
||||
|
@ -3,8 +3,13 @@ const client = require("../index");
|
||||
client.on("interactionCreate", async (interaction) => {
|
||||
// Slash Command Handling
|
||||
if (interaction.isChatInputCommand()) {
|
||||
console.log(interaction )
|
||||
if (interaction.commandName == "password-generator") {
|
||||
await interaction.deferReply({ ephemeral: true }).catch(() => { });
|
||||
} else {
|
||||
await interaction.deferReply({ ephemeral: false }).catch(() => { });
|
||||
|
||||
}
|
||||
const cmd = client.slashCommands.get(interaction.commandName);
|
||||
if (!cmd)
|
||||
return interaction.followUp({ content: "An error has occurred " });
|
||||
|
Loading…
Reference in New Issue
Block a user