I have developed a discord bot in python but getting problems in javascript one.
I have tried a few solutions from StackOverflow itself but I can't figure out how to make it work. And much confusion due to solutions available online about discord bot and whenever you try to deploy it as it shows many version/deprecation errors of nodejs and discord.
Problem is that my bot code as follows replying only when I mention them but I want it to reply on any message like for example I take "boomer"
as my message but the bot doesn't respond to it at all.
const Discord = require("discord.js");
const { Client } = require('discord.js');
const client = new Discord.Client({
intents: [
32509
]
})
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}!`);
client.user.setActivity('Running a test, hopefully.');
})
client.on("messageCreate", (message) => {
if (message.content.toLowerCase().includes("boomer")) {
message.channel.send("how are you there!");
}
if (message.author.bot) return false;
if (message.content.includes("@here") || message.content.includes("@everyone") || message.type == "REPLY") return false;
if (message.mentions.has(client.user.id)) {
message.channel.send("Hello there!");
}
});
client.login(process.env.TOKEN)