Markoudstaal / node-red-contrib-discord-advanced

Recieve, send, edit and delete Discord messages in node-red.
MIT License
46 stars 16 forks source link

Latest version crashes Node Red #91

Closed kylekrieg closed 4 months ago

kylekrieg commented 1 year ago

Here are the logs from when I try and start Node Red. It crashes on startup. I uninstalled the discord node and NR starts up normally.

Jun 22 08:45:03 elayerpi Node-RED[13207]: Welcome to Node-RED Jun 22 08:45:03 elayerpi Node-RED[13207]: =================== Jun 22 08:45:03 elayerpi Node-RED[13207]: 22 Jun 08:45:03 - [info] Node-RED version: v3.0.2 Jun 22 08:45:03 elayerpi Node-RED[13207]: 22 Jun 08:45:03 - [info] Node.js version: v16.20.0 Jun 22 08:45:03 elayerpi Node-RED[13207]: 22 Jun 08:45:03 - [info] Linux 5.15.84-v7l+ arm LE Jun 22 08:45:05 elayerpi Node-RED[13207]: 22 Jun 08:45:05 - [info] Loading palette nodes Jun 22 08:45:08 elayerpi Node-RED[13207]: 22 Jun 08:45:08 - [info] Worldmap version 2.37.4 Jun 22 08:45:08 elayerpi Node-RED[13207]: 22 Jun 08:45:08 - [info] Dashboard version 3.5.0 started at /ui Jun 22 08:45:09 elayerpi Node-RED[13207]: 22 Jun 08:45:09 - [info] Settings file : /home/pi/.node-red/settings.js Jun 22 08:45:09 elayerpi Node-RED[13207]: 22 Jun 08:45:09 - [info] Context store : 'default' [module=memory] Jun 22 08:45:09 elayerpi Node-RED[13207]: 22 Jun 08:45:09 - [info] User directory : /home/pi/.node-red Jun 22 08:45:09 elayerpi Node-RED[13207]: 22 Jun 08:45:09 - [info] Projects directory: /home/pi/.node-red/projects Jun 22 08:45:09 elayerpi Node-RED[13207]: 22 Jun 08:45:09 - [info] Server now running at http://127.0.0.1:1880/ Jun 22 08:45:10 elayerpi Node-RED[13207]: 22 Jun 08:45:10 - [info] Active project : Elayer Jun 22 08:45:10 elayerpi Node-RED[13207]: 22 Jun 08:45:10 - [info] Flows file : /home/pi/.node-red/projects/Elayer/flows_elayerpi.json Jun 22 08:45:10 elayerpi Node-RED[13207]: 22 Jun 08:45:10 - [warn] Using unencrypted credentials Jun 22 08:45:10 elayerpi Node-RED[13207]: 22 Jun 08:45:10 - [info] Starting flows

Jun 22 08:45:13 elayerpi Node-RED[13207]: 22 Jun 08:45:13 - [error] Error: Used disallowed intents Jun 22 08:45:13 elayerpi Node-RED[13207]: at WebSocketShard.onClose (/home/pi/.node-red/node_modules/@discordjs/ws/dist/index.js:1066:15) Jun 22 08:45:13 elayerpi Node-RED[13207]: at WebSocket.emit (node:events:513:28) Jun 22 08:45:13 elayerpi Node-RED[13207]: at WebSocket.emitClose (/home/pi/.node-red/node_modules/@discordjs/ws/node_modules/ws/lib/websocket.js:258:10) Jun 22 08:45:13 elayerpi Node-RED[13207]: at TLSSocket.socketOnClose (/home/pi/.node-red/node_modules/@discordjs/ws/node_modules/ws/lib/websocket.js:1264:15) Jun 22 08:45:13 elayerpi Node-RED[13207]: at TLSSocket.emit (node:events:525:35) Jun 22 08:45:13 elayerpi Node-RED[13207]: at node:net:301:12 Jun 22 08:45:13 elayerpi Node-RED[13207]: at TCP.done (node:_tls_wrap:588:7) Jun 22 08:45:13 elayerpi systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE Jun 22 08:45:13 elayerpi systemd[1]: nodered.service: Failed with result 'exit-code'. Jun 22 08:45:13 elayerpi systemd[1]: nodered.service: Consumed 13.932s CPU time. Jun 22 08:45:24 elayerpi systemd[1]: Stopped Node-RED graphical event wiring tool. Jun 22 08:45:24 elayerpi systemd[1]: nodered.service: Consumed 13.932s CPU time.

kylekrieg commented 1 year ago

Just some more info. I was using a previous version with no issue but when I upgraded, NR didn't start. I think I was running 3.4.3 or 3.4.4 before the upgrade to 3.4.5.

javis86 commented 1 year ago

I think the problem is on Intents.GUILD_MEMBER? It was added in order to use events guildMemberAdd and guildMemberRemove. And your bot does not have this permission

javis86 commented 1 year ago

The solution is to let the nodered user sets the intents that wants to use for his bot in discord-token node

kylekrieg commented 1 year ago

I enabled and looks like it installed fine with no errors. Thanks.

image

javis86 commented 4 months ago

https://github.com/Markoudstaal/node-red-contrib-discord-advanced/wiki#privileged-intents