Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to use Discord in my nodejs app But I am facong some error: DeprecationWarning: The message event is deprecated. Use messageCreate instead in Nodejs. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How This Erro Occurs ?
I am trying to use Discord in my nodejs app But I am facong some error.
(node:15928) DeprecationWarning: The message event is deprecated. Use messageCreate instead (Use `node –trace-deprecation …` to show where the warning was created)
How To Solve DeprecationWarning: The message event is deprecated. Use messageCreate instead Error ?
- How To Solve DeprecationWarning: The message event is deprecated. Use messageCreate instead Error ?
To Solve DeprecationWarning: The message event is deprecated. Use messageCreate instead Error try to change: message.channel.send(newEmbed); to message.channel.send({ embeds: [newEmbed] }); Now, Your error will be solved.
- DeprecationWarning: The message event is deprecated. Use messageCreate instead
To Solve DeprecationWarning: The message event is deprecated. Use messageCreate instead Error You Just need to use messageCreate instead of message Just like this: client.on(‘messageCreate’, message => ”) And Now, Your error must be solved.
Solution 1: Use messageCreate instead of message
You Just need to use messageCreate instead of message Just like this.
client.on('messageCreate', message => '')
And Now, Your error must be solved.
Solution 2: Change this
try to change.
message.channel.send(newEmbed);
to
message.channel.send({ embeds: [newEmbed] });
Now, Your error will be solved.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read