So I'm starting up a new discord bot, and I'm fairly new to it all. I'm using discord.js as the library, and it certainly contains most of the tools I need to make what I want.
The issue is that I want to implement a database that can track user stats and such. I've thought about using the Collection/Map classes to have each user ID act as a key to an array that saves this data, but I need somewhere to save/load this data since as far as I'm aware the database wipes every time I restart the code.
Is there a efficient write/read system for doing this in javascript? Would it work well if I put my bot on a dedicated server?
>>60898721
STOP USING THIS UGLY FAGGOT ASS PIECE OF SHIT STOP USING THIS UGLY FAGGOT ASS PIECE OF SHIT STOP USING THIS UGLY FAGGOT ASS PIECE OF SHIT STOP USING THIS UGLY FAGGOT ASS PIECE OF SHIT STOP USING THIS UGLY FAGGOT ASS PIECE OF SHIT STOP USING THIS UGLY FAGGOT ASS PIECE OF SHIT STOP USING THIS UGLY FAGGOT ASS PIECE OF SHIT STOP USING THIS UGLY FAGGOT ASS PIECE OF SHIT
What are you using to run this javascript?
Nodejs? I'm pretty sure it has plenty of filesaving functions.
>>60898734
t. Angry TS user
>>60899052
>ts
ewww
>>60898721
>using something that bans lolis
>>60898721
use any database you're comfortable with. there are plenty of drivers on npm.
>>60899166
This.
>>60898721
Why not just use a JSON file.
>>60899537
>>60899166
I was hoping for a bit more depth in the answers. Like I said I'm fairly new to this. I've done s decent amount of programming in java, and javascript is just different enough to throw me off at key points.
>>60900967
>Java
>JavaScript
>Discord
Unless you're willing to change your mind and develop this bot for Matrix, get out.
https://matrix.org
>>60900967
Use MySQL.
Install it usingnpm install mysql
Documentation available here: https://www.npmjs.com/package/mysql
>>60898721