Register: Always defer and update replies

This commit is contained in:
2023-01-02 19:25:36 +01:00
parent c866bc08eb
commit c29c018bba

View File

@@ -8,13 +8,14 @@ module.exports = {
.setDescription("Register yourself"), .setDescription("Register yourself"),
permissionLevel: 0, permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
await interaction.deferReply();
let user = await User.findOne({ let user = await User.findOne({
where: { where: {
discordId: interaction.user.id discordId: interaction.user.id
} }
}); });
if (user) { if (user) {
interaction.reply({ interaction.editReply({
content: "You are already registered", content: "You are already registered",
ephemeral: true ephemeral: true
}); });
@@ -23,7 +24,7 @@ module.exports = {
discordId: interaction.user.id, discordId: interaction.user.id,
active: 1, active: 1,
}); });
interaction.reply({ interaction.editReply({
content: "You are now registered", content: "You are now registered",
ephemeral: false ephemeral: false
}); });