In my humble and personal opinion I think that that question should have not been closed at all, not for:
seeking recommendations for books, tools, software libraries and more
and not as a "duplicate".
First of all he is not asking for code (or at least he didn't say that, maybe he's expecting that, but he didn't directly ask for it, we will never know).
He obviously is not asking for manuals and stuff.
For second the question specifically asks how to log crash reports of a discord bot to a file, the "duplicate" just asks how to write to file with Javascript. I have never touched a discord bot but usually, in my experience, catching a crash error is not as simple as "writing the error to a file", maybe the crash he has doesn't even produce an error to log.
There's even already an answer in the comments
Have you thought about using something like sentry?
And that could have been all that the OP needed.
This question had surely room for improvement, but maybe giving some feedback instead of just closing the question is more beneficial to the whole community.
Lately it appears to me that people close questions just for the sake of it, just because they already know the answer, to feel paladins of justice and/or just for trolling newcomers. I think the question the OP links falls into one of this categories.
As i said in a comment somewhere around here I think that closing questions should be harder and maybe require some kind of comment instead of the prepared statements or a certain number of votes from mods, this would make closing a truly useful tool to close questions that can't and won't be answered (such as the ones VLAZ posted in the comments of this question) instead of a way to annoy someone you deem inferior.
EDIT(from comments):
After reading a lot of comments I came to the conclusion that this is not a solvable problem. The "purist" faction will always accuse the others of wanting easy code to copy and the others will always accuse the first of being douches.
As both kind of people coexist on the platform we are just throwing feces at each other while people who do not care about SO at all continue to post awful questions and close good questions in the background. We are too focused on fighting the other faction while bad apples do every kind of mischief in this mess.
We all just want to improve StackOverflow, but are not willing to accept other solutions but ours, when the real solution is not one OR the other, but one AND the other.