Skip to content Skip to sidebar Skip to footer

Typeerror: Class Extends Value Command Is Not A Constructor Or Null - Node.js

I tried to make a !warn command, so that I can warn people in my server and if you have 2 warns you get a mute etc. When I was done there was only 1 error left. I tried many things

Solution 1:

It should be class Warn extends Command, not class Warn extends ("Command"). I think, you try to extend the Command class from Discord.js Commando.

You can only extend classes, not strings.

Also, make sure you import the class in your file:

const { Command } = require('discord.js-commando');
const ms = require("ms");

classWarnextendsCommand {
  constructor(client) {
    super(client, {
      name: "warn",
      ...

Post a Comment for "Typeerror: Class Extends Value Command Is Not A Constructor Or Null - Node.js"