Can bot detect other bot message?

Can bot detect other bot message? Like if the bot send hi, my bot will send hello
6 Replies
d.js toolkit
d.js toolkit12mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
treble/luna
treble/luna12mo ago
if you do not ignore messages from other bots, which i do not recommend because you will probably create a loop of your bot replying to itself
CoolName
CoolName12mo ago
how to make it dont ignore message from other bots?
treble/luna
treble/luna12mo ago
by not using that if(user.bot) statement but again that's a really bad idea
d.js docs
d.js docs12mo ago
It's good practice to make your bots ignore other bots, including itself. This can be done through a single line of code:
if (<message>.author.bot) return;
if (<message>.author.bot) return;
<message> being whatever you defined message as.
Loux
Loux12mo ago
if (<user>.bot && <user>.id !==
<client>.user.id) {

}
if (<user>.bot && <user>.id !==
<client>.user.id) {

}