This is what my discord bot.js looks like.
Basically, I thought that when I type in "ten bot je fakt sračka" it gives one of the responses in the array.
If I type in "ahoj", it gives that response with a few hearts.
And also when I type in "test", it should reply with "test".
Now, when I run the bot and type in any of the three messages, if only replies "test" to "test". Nothing else gets a response. What do I do?
const Discord = require("discord.js");
const client = new Discord.Client();
client.login("TOKEN");
client.on("ready", readyDiscord);
function readyDiscord() {
console.log("123");
}
const replies = ["Stop it!", "Bot lives matter! <:ragey:776017536973013003>", "no", "<:jakjestvbiblipsno:776002959665266709>"];
client.on("message", gotMessage);
function gotMessage(msg) {
console.log(msg.content);
if (msg.content === "ten bot je fakt sračka") {
const index = Math.floor(Math.random() * replies.length);
msg.channel.send(replies[index]);
}
}
function gotMessage(msg) {
console.log(msg.content);
if (msg.content === "ahoj") {
msg.reply("Ahoj <3<3<3");
}
}
function gotMessage(msg) {
console.log(msg.content);
if (msg.content === "test") {
msg.reply("test");
}
}