Issue with a Discord.js command giving Internal Error

Hello, I have been making a discord bot but one command doesn’t seem to work. ` if (command === “ban”) {
// Most of this command is identical to kick, except that here we’ll only let admins do it.
// In the real world mods could ban too, but this is just an example, right? :wink:
if (
!message.member.roles.cache.some(r => [“MOD”].includes(r.name))
)
return message.reply(“Sorry, you don’t have permissions to use this!”);

let member = message.mentions.members.first();
if (!member)
  return message.reply("Please mention a valid member of this server");
if (!member.bannable)
  return message.reply(
    "I cannot ban this user! Do they have a higher role? Do I have ban permissions?"
  );

let reason = args.slice(1).join(" ");
if (!reason) reason = "No reason provided";

await member
  .ban(reason)
  .catch(error =>
    message.reply(
      `Sorry ${message.author} I couldn't ban because of : ${error}`
    )
  );
message.reply(
  `${member.user.tag} has been banned by ${message.author.tag} because: ${reason}`
);

}this is what it says in discordI couldn’t ban because of : Response: Internal Server Error` what is the issue? I checked my code with discord.js.org but don’t see any issues.

Discord’s API might be having some issues, try again later.

Ohh, alright. Didn’t think of that lol.

1 Like

500 errors often mean that the problem is with the server, good luck with this later!

Its still giving the error. I tried using other bots to do it and they work but for some reason mine gives Internal Error alert. Could it be an issue with the code?