Make several replies ephemeral

This commit is contained in:
Alexandertp 2024-11-20 16:44:12 +01:00
parent eee43d2976
commit ae61e4761f

View File

@ -49,12 +49,12 @@ client.on('interactionCreate', async(interaction) => {
const gearType = interaction.options.get('geartype').value;
const employee = interaction.options.get('employee').value;
if ( addRemove == 'add') {
AddGear(gearType, employee)
interaction.reply(`Added a gear to ${employee}`)
const gearAdded = AddGear(gearType, employee)
interaction.reply({content: `Added a ${gearAdded} to ${employee}`, ephemeral: true})
};
} else if (interaction.commandName === 'gear' && !isManager) {
interaction.reply("You aren't a manager! Get back to work.")
interaction.reply({content:"You aren't a manager! Get back to work.", ephemeral: true})
};
if (interaction.commandName === 'employee' && isManager) {
@ -69,7 +69,7 @@ client.on('interactionCreate', async(interaction) => {
interaction.reply(`Fired ${employeeName}`)
}
} else if (interaction.commandName === 'employee' && !isManager) {
interaction.reply("You aren't a manager! Get back to work.")
interaction.reply({content:"You aren't a manager! Get back to work.", ephemeral: true})
};
if (interaction.commandName === 'promote' && isManager) {
@ -78,7 +78,7 @@ client.on('interactionCreate', async(interaction) => {
PromoteEmployee(employeeName, rank);
interaction.reply(`Changed ${employeeName}\'s rank to ${rank}`);
} else if (interaction.commandName === 'promote' && !isManager) {
interaction.reply("You aren't a manager! Get back to work.")
interaction.reply({content:"You aren't a manager! Get back to work.", ephemeral: true})
};
if (interaction.commandName === 'rename' && isManager) {
@ -102,7 +102,7 @@ client.on('interactionCreate', async(interaction) => {
if (scoreBoardMessage != "") {
gearchannel.send(scoreBoardMessage);
interaction.reply("Displaying Scoreboard");
interaction.reply({content: "Displaying Scoreboard", ephemeral: true});
}
else {
console.log("Something went wrong when building the scoreboard.");
@ -113,7 +113,7 @@ client.on('interactionCreate', async(interaction) => {
const gearMessage = await messagesInGearchannel.find(msg => msg.author.id === '1306647733490290809')
if (gearMessage === undefined) {
interaction.reply("Could not find a message to update, did you remember to display it first?");
interaction.reply({content: "Could not find a message to update, did you remember to display it first?", ephemeral: true});
}
else {
gearMessage.edit(scoreBoardMessage);
@ -121,7 +121,7 @@ client.on('interactionCreate', async(interaction) => {
}
}
} else if (interaction.commandName === 'scoreboard' && !isManager) {
interaction.reply("You aren't a manager! Get back to work.")
interaction.reply({content:"You aren't a manager! Get back to work.", ephemeral: true})
};
});
@ -143,6 +143,8 @@ function AddGear(Type,Employee) {
}
if (Type != "coppergear" && Type != "silvergear" && Type != "goldgear" && Type != "purplegear") return
db.run(`UPDATE Employees SET ${Type} = ${Type} + 1 WHERE name = \'${Employee}\' `)
return Type;
};
function RemoveGear(Type, Employee) {
if (Type != "coppergear" && Type != "silvergear" && Type != "goldgear" && Type != "purplegear") return