botkalista / discord.js.userbot

Allow discord.js to login as User
MIT License
25 stars 6 forks source link

Getting error #9

Open g0dzcsgo opened 2 years ago

g0dzcsgo commented 2 years ago

I am getting error when trying to start the bot.

/home/bot/node_modules/discord.js/src/rest/RESTManager.js:32 const token = this.client.token ?? this.client.accessToken; ^

SyntaxError: Unexpected token ? at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:616:28) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (/home/bot/node_modules/discord.js/src/client/BaseClient.js:4:21)

eoriont commented 2 years ago

The ?? operator exists in js: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator

Can you make sure that the version of javascript that you're running supports this operator?