Skip to content
← Back to Community
my discord bot wont go online
Profile icon
RpRDeeJay

the only error message im getting is this and i have no idea what to do
i have searched high and low for this extra "?" and it is nowhere to be seen.

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

SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/runner/gtarpbotRETRY/node_modules/discord.js/src/client/BaseClient.js:4:21)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
exit status 1

Voters
Profile icon
RpRDeeJay
Comments
hotnewtop
Profile icon
AidenHoffman1

Dm me on discord

Volactic-fish7#5459

Profile icon
RpRDeeJay

@AidenHoffman1 hey, i believe i have fixed it now, it was a problem with the code i was using as some of the JS was in old style. also your username returned incorrect when i tried to add you as a friend

Profile icon
itslexanplayz

@RpRDeeJay can you tell me how to fix it too? I am also encountering the same error.

Profile icon
RpRDeeJay

@itslexanplayz hey dude
at the start of my commands there was this line of code:
s4d.client.on('CreateMessage', async (s4dmessage) => {
where it says "create message" remove "create" and leave "message" and it works for me, good luck!