I tried to create a ban command, but while starting I got the error: The application did not respond from discord. If you know how can I fix it I will be very grateful, this is my code:
const commandsHandler = require("../../Handlers/commands-handler");
module.exports = {
name: "ban",
description: "Ban a member from the server.",
permission: "ADMINISTRATOR",
options: [{
name: "target",
type: "USER",
description: "The target you want to ban.",
required: true
},
{
name: "reason",
type: "STRING",
description: "Reason for ban.",
required: false,
}
],
execute(inter, client) {
run: async(inter, client) => {
const user = inter.options.getUser("target")
let BanReason = inter.options.getString("reason")
const member = inter.guild.members.cache.get(user.id)
if(!member) return inter.reply("The target doesn't exist in the server.")
if(!BanReason) BanReason = "No reason provided"
await inter.guild.members.ban(member, { reason: BanReason })
inter.reply(`Sucessfully banned ${user.tag}\nreason: ${BanReason}`)
.catch(() => {
inter.reply("Cannot ban the member.")
})
}
}
}```