Anon64 / UnturnedDiscordBridge

A node.js server to work with the UnturnedDiscordBridge plugin
MIT License
0 stars 1 forks source link

Intents no longer exist in discord.js v14, use gatewayIntentBits instead #1

Open Silverr12 opened 2 years ago

Silverr12 commented 2 years ago

`const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS] }); ^

TypeError: Cannot read properties of undefined (reading 'FLAGS') at Object. (C:\David\UnturnedServer\UnturnedDiscordBridge-main\index.js:6:63) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47`

fix detailed here: https://stackoverflow.com/questions/73054433/discord-js-typeerror-cannot-read-properties-of-undefined-reading-flags

There is the option of just having people download v13 aswell

RainOfPain125 commented 1 year ago

const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS] }); ^ TypeError: Cannot read properties of undefined (reading 'FLAGS') at Object. (C:\SERVERS\UnturnedDiscordBridge-main\UnturnedDiscordBridge-main\index.js:6:63) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47

Same issue I guess.

RainOfPain125 commented 1 year ago

I figured out how to get the old 13v

PS C:\SERVERS\UnturnedDiscordBridge-main\UnturnedDiscordBridge-main> npm i discord.js@13.0.0 npm WARN deprecated discord-api-types@0.22.0: No longer supported. Install the latest release! npm WARN deprecated @discordjs/form-data@3.0.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @discordjs/builders@0.4.0: no longer supported npm WARN deprecated @discordjs/collection@0.2.4: no longer supported npm WARN deprecated discord.js@13.0.0: no longer supported

added 28 packages, and audited 29 packages in 5s

4 packages are looking for funding run npm fund for details

found 0 vulnerabilities

But that doesn't solve this issue

PS C:\SERVERS\UnturnedDiscordBridge-main\UnturnedDiscordBridge-main> node index.js Logging in as Rainie.Day Bot#7102 node:fs:600 handleErrorFromBinding(ctx); ^

Error: ENOENT: no such file or directory, open '\.\pipe\CS2N.pipe' at Object.openSync (node:fs:600:3) at Client. (C:\SERVERS\UnturnedDiscordBridge-main\UnturnedDiscordBridge-main\index.js:35:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errno: -4058, syscall: 'open', code: 'ENOENT', path: '\\.\pipe\CS2N.pipe' }

Assuming "CS2N.pipe" is something I'm supposed to install, it doesn't work.

PS C:\SERVERS\UnturnedDiscordBridge-main\UnturnedDiscordBridge-main> npm install CS2N.pipe npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/CS2N.pipe - Not found npm ERR! 404 npm ERR! 404 'CS2N.pipe@*' is not in this registry. npm ERR! 404 This package name is not valid, because npm ERR! 404 1. name can no longer contain capital letter. npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

RainOfPain125 commented 1 year ago

Also tried these assuming "CS2N.pipe" was an abbrevation that I wasnt supposed to use

PS C:\SERVERS\UnturnedDiscordBridge-main\UnturnedDiscordBridge-main> npm install CStoNodePipe npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/CStoNodePipe - Not found npm ERR! 404 npm ERR! 404 'CStoNodePipe@*' is not in this registry. npm ERR! 404 This package name is not valid, because npm ERR! 404 1. name can no longer contain capital letters npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

N2CS.pipe too.

PS C:\SERVERS\UnturnedDiscordBridge-main\UnturnedDiscordBridge-main> npm install NodetoCSPipe npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/NodetoCSPipe - Not found npm ERR! 404 npm ERR! 404 'NodetoCSPipe@*' is not in this registry. npm ERR! 404 This package name is not valid, because npm ERR! 404 1. name can no longer contain capital letters npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

I'm not a programmer, but trying to run your plugin shouldn't have to make me one.