ProgrammingDiscord Bot Troubles
Posted:

ProgrammingDiscord Bot TroublesPosted:

Suss
  • Winter 2019
Status: Offline
Joined: Apr 14, 201212Year Member
Posts: 1,221
Reputation Power: 74
Status: Offline
Joined: Apr 14, 201212Year Member
Posts: 1,221
Reputation Power: 74
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.
node index.js
to launch my bot, nothing works

Error:
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)

Programs:
Visual Studio Code
Node.js

If you're familiar with the topic or may have a solution be sure to let me know
#2. Posted:
CriticaI
  • Shoutbox Hero
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
"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'
});


discord.js.org/#/docs/commando/ma...irst-steps


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:


RECENT POSTS

HOT TOPICS