#```js
1 messages · Page 1 of 1 (latest)
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');
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
Yeah I removed the deferReply now only thing is that its still looping the 'is thinking' message but the kick function works fine
If it's stuck at "is thinking" then that means you are never reaching an editReply
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."
You're missing something after this
if (!interaction.member.permissions.has(['KICK_MEMBERS']))