Discord.js: loginWithToken is not a function

Created on 8 Sep 2016  路  5Comments  路  Source: discordjs/discord.js

/root/dscrd/him.js:773
c.loginWithToken(config.token,"","")
  ^

TypeError: c.loginWithToken is not a function
    at Object.<anonymous> (/root/dscrd/him.js:773:3)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

This is my bot's starting code:

Discord=require("discord.js");
var config = require("./config.json")
var enableOptional = config.enableOptional
var logfile = config.logfile

c.loginWithToken(config.token,"","")

Any ideas why this is happening? :/

All 5 comments

It isn't supposed to be a function and it will not be added. Read the documentation.

Because if you read the docs you will see that version 9 has changed that to client.login()

Thanks, i didnt know that discord.js got updated, i just reinstalled my server so i was confused why it didnt work anymore!

Kind sir, are you aware of the documentation

@FrankenMan see what i literally just posted

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DatMayo picture DatMayo  路  3Comments

LLamaFTL picture LLamaFTL  路  3Comments

smchase picture smchase  路  3Comments

tiritto picture tiritto  路  3Comments

Lombra picture Lombra  路  3Comments