I'm trying to make a discord bot that counts how many times you've said the word turtle, in a specific channel. Discord.js, I don't really see any way to do this, What would be a good place to start off with the code? Also a way to say turtlecount in another channel and it shows how many times you have said the word turtle in the turtle channel.
Asked
Active
Viewed 3,373 times
-1
-
Hi Fuzzy UwU. Welcome to StackOverflow. Please Google it to find tutorial that you'd like the most. When you'll have any trouble, please search, maybe someone has asked such (or similar) question on StackOverflow - if not, please create a question, describing the problem, showing your code and what you've tried. https://stackoverflow.com/help/how-to-ask – greenmarker Jun 21 '20 at 12:28
2 Answers
0
I believe something like this should work:
if (args.includes("turtle").toLowerCase()){
let turtleCount = turtleCount + 1;
};

CedarBlocks
- 86
- 6
0
You will probably need a database if you want to store the "turtle" word count for each user of your server, I would suggest you, as a database, mongoDB but there are many others, you can even use a simple json file, even if not recommended.
After that is easy, this is an example of some code you could use to detect if a message contains the word "turtle" and if it's in a specific channel:
if(message.content.toLowerCase().includes('turtle') && message.channel.ID === 'channel ID'){
//Increment member 'turtle' word counter in the database
}

Giuliopime
- 707
- 4
- 21