alexemanuelol / RustPlus-Discord-Bot

This is an NodeJS Discord Bot that uses the rustplus.js to interact with Smart Devices in the PC game Rust.
GNU General Public License v3.0
31 stars 12 forks source link

Bug : Uncaught Error Error: ENOENT: no such file or directory, open './config.json' #11

Closed furcoite-nirual closed 1 year ago

furcoite-nirual commented 1 year ago

Hello, i been following the documentation about this bot yesterday. Everything is set up, Rust+ is paired with the server, the config had been wrote from this "FCM" and i copied my discord token and the id of the spam text channel in the config.js.

Now i want to run the script "rustplusDiscordBot.js" to start the bot and this error occures in my debug console:

D:\Program Files\nodejs\node.exe .\rustplus\RustPlus-Discord-Bot-main\rustplusDiscordBot.js
Uncaught Error Error: ENOENT: no such file or directory, open './config.json'
    at handleErrorFromBinding (internal/fs/utils:344:5)
    at openSync (fs:585:3)
    at readFileSync (fs:453:35)
    at readJSON (c:\Users\nette\Desktop\code\rustplusweb\rustplus\RustPlus-Discord-Bot-main\tools\tools.js:7:23)
    at <anonymous> (c:\Users\nette\Desktop\code\rustplusweb\rustplus\RustPlus-Discord-Bot-main\rustplusDiscordBot.js:116:20)
    at Module._compile (internal/modules/cjs/loader:1105:14)
    at Module._extensions..js (internal/modules/cjs/loader:1159:10)
    at Module.load (internal/modules/cjs/loader:981:32)
    at Module._load (internal/modules/cjs/loader:822:12)
    at executeUserEntryPoint (internal/modules/run_main:77:12)
    at <anonymous> (internal/main/run_main_module:17:47)

I know what the error "means" but i dont know why the script dosnt find the config.json. Thats my project folder. There you can clearly see the config.json. image image

Ive been coding with nodejs for a while and my theory is that there is maybe something up with ur code or im way to dumb to see my mistakes.

I hope you can help me, THX

alexemanuelol commented 1 year ago

Ive abandoned this project and made a more advanced bot called rustPlusPlus. Use it instead 😁

furcoite-nirual commented 1 year ago

I know i know but can i ask why you used a exe (application) as the fcm? Why dont use the normal command of the rustplus.js library instead? I dont know if i can trust that application

alexemanuelol commented 1 year ago

I added an .exe in the release for convenience, you can still build the application manually by following the instructions in src/credentialApplication/README.md. The reason I don't use the "normal command" is because it is not that user-friendly. Since this bot isnt really scalable as rustPlusPlus, you could just paste the entire rustplus.config.json in the root directory. But since rustPlusPlus is implemented to support multiple users, you need to transfer the fcm credentials somehow, and doing it via a slash command was the most effective way. And since most users of the bot isnt that technical, a graphical user interface would be ideal.

But like I said, you can still build the application manually or just run it in development mode.

furcoite-nirual commented 1 year ago

Ok thanks for your anwsers i will follow your instructions👍