davidcralph / hastebin-bot

An opensource bot for Discord that posts data to Hastebin
MIT License
24 stars 4 forks source link

Issues with bot #31

Open johncsuti opened 2 years ago

johncsuti commented 2 years ago

There are 2 noticeable issues with the bot one being [Error: ENOENT: no such file or directory, scandir './events/'] { errno: -2, code: 'ENOENT', syscall: 'scandir', path: './events/' } [Error: ENOENT: no such file or directory, scandir './commands/'] { errno: -2, code: 'ENOENT', syscall: 'scandir', path: './commands/' } The fix for this is to replace ./events/ and ./commands/ with ./src/events/ and ./src/commands/ respectively

Finally there is this issue when you try to upload. node:fs:585 handleErrorFromBinding(ctx); ^

Error: ENOENT: no such file or directory, open 'this' at Object.openSync (node:fs:585:3) at Object.readFileSync (node:fs:453:35) at Object.exports.run (/home/container/src/commands/haste.js:12:42) at module.exports (/home/container/src/events/message.js:14:9) at Client.emit (node:events:390:28) at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14) at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32) at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31) at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22) at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10) { errno: -2, syscall: 'open', code: 'ENOENT', path: 'this' } The fix for this being setting dir_uploader to false in the config.json

johncsuti commented 2 years ago

Seems like Pull request #30 is problematic?

davidcralph commented 2 years ago

I've taken a look into this and fixed the issue caused by #30

I can't reproduce the top issue, what command are you using to start the bot?

johncsuti commented 2 years ago

Its a kinda long command ran by pterodactyl here is the full command: if [[ -d .git ]] && [[ ${AUTO_UPDATE} == "1" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then /usr/local/bin/npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then /usr/local/bin/npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f /home/container/package.json ]; then /usr/local/bin/npm install; fi; /usr/local/bin/node /home/container/${BOT_JS_FILE}

johncsuti commented 2 years ago

I've taken a look into this and fixed the issue caused by #30

I can't reproduce the top issue, what command are you using to start the bot?

Updated the bot and found the issue is still kinda there nothing gets uploaded. Here is what discord says: (There is no error in console) Screenshot from 2021-10-16 19-08-15 Once again turning off dir_upload fixes the top issue the bottom issue still doesn't work.