ProgrammingDiscord Bot TroublesPosted:

  • E3 2017
Status: Offline
Joined: Apr 14, 20127 Year Member
Posts: 1,129
Reputation Power: 66
So just within a few hours ago i decided to develop a new bot for discord however when i try to get my bot online with commands such as:
node bot.js
node index.js
to launch my bot, nothing works

TypeError: commando.client is not a constructor
at Object.<anonymous> (D:\Family\Desktop\Creating discord bots\uav\index.js:2:11)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:775:12)
at startup (internal/bootstrap/node.js:300:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:826:3)

Visual Studio Code

If you're familiar with the topic or may have a solution be sure to let me know
#2. Posted:
  • TTG Addict
Status: Offline
Joined: Nov 05, 20135 Year Member
Posts: 2,643
Reputation Power: 153
"commando.client is not a constructor" is caused when you try to use a method or a function as a class. If you used
new commando.client()
then that is probably what is causing the error. Also, make sure everything is capitalized and spelled properly.

The docs says it should look like this.
const Commando = require('discord.js-commando');

const client = new Commando.Client({
    owner: '1234567890'

[ Register or Signin to view external links. ]

If none of this works then you need to show some of your code or give some more information because an error code really isn't enough information.
Users browsing this topic: None
Jump to: