#```js

1 messages · Page 1 of 1 (latest)

boreal galleon
#

I made the first reply be the await defer so
await interaction.deferReply('You do not have permission to use this command.');
and the other 2 replies have the editReply
if (!target) return interaction.editReply('User not found.')
return interaction.editReply('User has been kicked successfully');

thin blaze
#

You do not have permission to use this command
This text will not show up anywhere

#

Otherwise looks fine as long as the top line is always called

boreal galleon
#

Yeah I removed the deferReply now only thing is that its still looping the 'is thinking' message but the kick function works fine

thin blaze
#

If it's stuck at "is thinking" then that means you are never reaching an editReply

#

Post the full code

boreal galleon
# thin blaze Post the full code

module.exports = {
    data: new SlashCommandBuilder()
    .setName('tkick')
    .setDescription('Kicks the specified user by tag (Moderation)')
    .addUserOption(option => 
        option.setName('user')
        .setDescription('The user to be kicked')
            .setRequired(true))

      .addStringOption(option =>
           option
              .setName('reason')
                 .setDescription('The reason for the kick')
                  .setRequired(true)),

            async execute(interaction, client) {
                if (!interaction.member.permissions.has(['KICK_MEMBERS'])) 
                await interaction.deferReply();

                // Get the user from the interaction options
                const target = interaction.options.getMember('user');
                const reason = interaction.options.getString('reason') ?? 'No reason provided';
                if (!target) return interaction.editReply('User not found.')

                // Kick the user
                await interaction.guild.members.kick(target);

                // Reply with the text
                return interaction.editReply('User has been kicked successfully');
            } 
}```
#

I was thinking it could be "await interaction.guild.members.kick(target);" since its getting past the kick function but its the only thing before the editreply

#

It gives an error "Error [InteractionNotReplied]: The reply to this interaction has not been sent or deferred." and "DiscordAPIError[40060]: Interaction has already been acknowledged."

thin blaze
#

You're missing something after this
if (!interaction.member.permissions.has(['KICK_MEMBERS']))

boreal galleon
#

I do not know

#

I got rid of the "The reply to this interaction has not been sent or " now its just "Interaction has been ackknowledged