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

254
Views
I keep getting this error on my unban command discord.js v13

error

module.exports = { name: 'unban', description: "Used to unban members from a server", execute(message, args, Discord, client) {

if (!(message.member.roles.cache.some(r => r.id === "783700556472254525"))) return

  let reason;

  const user = await bot.users.fetch(args[0])

  if (!args[1])
  {
    reason = "Not specified"
  }

  else
  {
    reason = args[1]
  }

  const embed = new Discord.MessageEmbed()
  .setTitle(`${user.username} was unbanned!`)
  .setDescription(`${user.username} was unbanned by ${message.author.username} for: ${reason}`)
  .setColor("GREEN")
  .setFooter("Unban Command")
  .setTimestamp()

  message.channel.send(embed)

  message.guild.members.unban(user)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The error happens because to use await, the execute function has to be asynchronous, so all you have to do is add async before the execute like this: async execute() {}. This is why, it is better to actually spend some time and learn the language instead of copy pasting since many error like this can be easily answered.

about 4 years ago · Juan Pablo Isaza Report
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!