Adding defer reply

This commit is contained in:
2023-03-19 14:30:43 +01:00
parent 234295a3f0
commit 9dd175dd82

View File

@@ -24,15 +24,15 @@ module.exports = {
const userRoles = guild.members.cache.get(user.id).roles.cache.map(role => role.id); const userRoles = guild.members.cache.get(user.id).roles.cache.map(role => role.id);
if (userRoles.includes(guildRole)) {
await interaction.reply({ content: "You are already a member of the guild.", ephemeral: true });
return
}
if (interaction.customId === 'guildapply') { if (interaction.customId === 'guildapply') {
await interaction.deferReply(); await interaction.deferReply();
if (userRoles.includes(guildRole)) {
await interaction.editReply({ content: "You are already a member of the guild.", ephemeral: true });
return
}
const applicationFile = path.join(__dirname, '../../apps/guild/' + user.id); const applicationFile = path.join(__dirname, '../../apps/guild/' + user.id);
if (fs.existsSync(applicationFile)) { if (fs.existsSync(applicationFile)) {
await interaction.editReply({ content: "You already have an application in progress.", ephemeral: true }); await interaction.editReply({ content: "You already have an application in progress.", ephemeral: true });