The bot crashes after sending one or two direct messages to the newly joined members
I am using discord.js v14. The code works. However, I don't think it is a rate limit because I checked there were only one or two members joining my discord, so it won't be rate limit. Anyway, I tried logging the error message, but nothing showed up in same directory where the index.js with the code resides. Please see attached images for the code. Thanks if any of you could help pinpoint the error. And why is that?


9 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!catch and log your errors properly instead of writing them to a file
also whats the point of that code?
just do it direclty in the event, why overcomplicate it
Is there a way to log it to the file in synology nas as I am hosting my bot on synolgoy nas. The reason not doing that in the event is because of rate limit just in case if there are several members joining the server at the same time.
you should find hosting that allows you to view a console, instead of doing it via this weird way
if your bot crashes you wont ever know why because it cant write to the file
Well. It is weird that hosting it seems to mitigate the problem a bit. Why is that do you know based on your experience?
how are you running the bot? there must be some way you can see the console output without relying on the file
because i've never seen one host a bot on a nas
your crash could have many causes, but thats why you need a console
I don't see any errors after hosting it on some sort of a node.js server.
Yup one bot I host it on nas and is working fine.
a nas isnt meant to host bots, so id recommend to switch that one over too