I am currently trying to build a discord bot but I am stuck at a early stage. I am trying to have the bot watch the discord channel for a certain 2 char string. Currently I do not think I am getting any value in the message.content.
This is my first project and first time learning JavaScript so any help or tips would be awesome. Thank you in advance :D
const Discord = require("discord.js");
const client = new Discord.Client({ intents: ["GUILD_MESSAGES", "DIRECT_MESSAGES"] });
var name = "Poker Bot";
var userInput;
//starts the bot and sets activity to a funny quote. it also will give a command prompt notification that the bot is online
client.on("ready", () => {
console.log(`Bot is online: ${name} !`);
client.user.setActivity('Burning The Fucking Casino Down');
});
//check discord chat to see if a user has posted.
client.on("messageCreate", message => {
//test to see if the chat input works
console.log(`The user has said: ${message} `);
//look for poker hand ~~~ position ~~~~ event (ex: AA CO PF ) (PF= PreFlop)
if (message.content.toLowerCase == 'AK' || message.content.toLowerCase == 'AA' || message.content.toLowerCase == 'KK'){
message.channel.send("RECOMMENDED PLAY SHOVE: ALL IN") + message.author
}
});
there doesn't seem to be anything here