Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
Application didn't respond while starting ban command (discord.js)

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.")
            })
        }
    }
}```
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!