Androz2091 / discord-giveaways-bot

🎁Giveways Bot using the discord-giveaways package
ISC License
202 stars 167 forks source link

Error #92

Closed SJ-Tom closed 3 years ago

SJ-Tom commented 3 years ago

I tried to code a bot with the discord-giveaways package but an error came. Now I cloned the github repo and the same error came. Can anyone help me?

C:\[.....]\node_modules\discord-giveaways\src\Manager.js:368
                giveaway.message ??= await giveaway.fetchMessage().catch(() => {});
                                 ^^^

SyntaxError: Unexpected token '??='
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\[.....]\node_modules\discord-giveaways\index.js:3:23)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
Nico105 commented 3 years ago

discord-giveaways v5 is built for discord.js v13 And v13 requires node.js v16.6 = so we do it too, since we use features from 16.6 You need to update your node.js Edit: I didn't notice this was the bot repo, but still, you need node.js 16.6

SJ-Tom commented 3 years ago

I have the newest version of 14.16.1! What another can be the problem?

Nico105 commented 3 years ago

I have the newest version of 14.16.1! What another can be the problem?

Idk if you didn't read my comment correctly. But you need at least node.js 16.6.

SJ-Tom commented 3 years ago

Now I have 16.3.0 but there is another error

DiscordAPIError: Missing Access

Nico105 commented 3 years ago

Now I have 16.3.0 but there is another error

16.6

SJ-Tom commented 3 years ago

https://blog.risingstack.com/update-node-js-latest-version/ There is no 16.6 for Windows

Nico105 commented 3 years ago

Now I have 16.3.0 but there is another error

DiscordAPIError: Missing Access

did you adjust the guildId in the config file?

SJ-Tom commented 3 years ago

Yes

Nico105 commented 3 years ago

https://blog.risingstack.com/update-node-js-latest-version/ There is no 16.6 for Windows

don't research that on random blogs. https://nodejs.org/en/

SJ-Tom commented 3 years ago

There is also no 16.6 only 16.9

Nico105 commented 3 years ago

Yes

can you send the full error path, if there is one.

Nico105 commented 3 years ago

There is also no 16.6 only 16.9

doesn't matter. it just has to be "at least" 16.6 So you can be sure there will be no problems with discord.js v13

SJ-Tom commented 3 years ago

`C:[.....]\node_modules\discord.js\src\rest\RequestHandler.js:298 throw new DiscordAPIError(data, res.status, request); ^

DiscordAPIError: Missing Access at RequestHandler.execute (C:[.....]\node_modules\discord.js\src\rest\RequestHandler.js:298:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (C:[.....]\node_modules\discord.js\src\rest\RequestHandler.js:50:14) at async ApplicationCommandManager.fetch (C:[.....]\node_modules\discord.js\src\managers\ApplicationCommandManager.js:97:18) at async module.exports (C:[.....]\node_modules\discord-sync-commands\index.js:12:29) { method: 'get', path: '/applications/884819497356251198/guilds/859828412307079198/commands', code: 50001, httpStatus: 403, requestData: { json: undefined, files: [] } }`

SJ-Tom commented 3 years ago

Now I have 16.9.0 and the same API Error came

Nico105 commented 3 years ago

`C:[.....]\node_modules\discord.js\src\rest\RequestHandler.js:298 throw new DiscordAPIError(data, res.status, request); ^

DiscordAPIError: Missing Access at RequestHandler.execute (C:[.....]\node_modules\discord.js\src\rest\RequestHandler.js:298:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (C:[.....]\node_modules\discord.js\src\rest\RequestHandler.js:50:14) at async ApplicationCommandManager.fetch (C:[.....]\node_modules\discord.js\src\managers\ApplicationCommandManager.js:97:18) at async module.exports (C:[.....]\node_modules\discord-sync-commands\index.js:12:29) { method: 'get', path: '/applications/884819497356251198/guilds/859828412307079198/commands', code: 50001, httpStatus: 403, requestData: { json: undefined, files: [] } }`

ah, you will have to kick your bot. and when you invite him again, inside the invite link you have to include/edit scope=applications.commands%20bot,

Nico105 commented 3 years ago

Now I have 16.9.0 and the same API Error came

the api error is not related to the version

SJ-Tom commented 3 years ago

Thanks now everything works