Dont know this Warning

I get this warning in my Logs: (node:5111) DeprecationWarning: Collection#find: pass a function instead and dont know this. Should i do something? any kind of help is appreciated.

it is just a deprecation warning, meaning that of your code, or the code the packages you are using have a section of code that is being deprecated, nothing to worry about!

It also doesnt send this “your app is listening on Port 3000” anymore. but everything is working fine. Should i worry about that?


that just means that you removed the line of code that logs that the website is online, perfectly fine!

@WOLF0722, do you have this code in your server.js (or index.js or the name for the main node is file)

 const listener = app.listen(process.env.PORT, function() {
  console.log('Your app is listening on port ' + listener.address().port);

Yes but the message dont send in the logs. But the bot commands working fine

To fix the deprecation warning, do what the warning says, use a function instead. For example, if you have:

things.find("name", "Bob")

Replace that with:

things.find(thing => === "Bob")

When something is “deprecated”, it means that it’s going to be removed in a future version of whatever you’re using (in this case, Discord.js). Your current code works for now, but may not work in future versions of Discord.js, unless you make the change I said above. (This is why they give a deprecation warning–to warn you that things are changing.)

1 Like