How to make a SQL or FS database for claiming waifus. DISCORDJS

I want to make a database that stores the names of the waifu’s that someone claimed in a guild.

When I click the heart, it sends an embed:

and it also stores your account ID, the waifu name and the amount of waifu’s you’ve claimed in a database. All the data would also be stored in the guild ID you claimed the waifu in so that the waifu’s you’ve claimed won’t be global.

(I don’t want to manually put the guild ID’s or any of the other things I mentioned)

DM me on discord if you need any more details: HK#1331


I don’t like my sql a lot nor mongo

Why not?

Can you show me an example of how I would do it?

The code for the waifu command:

const {
} = require('discord.js');
const {
} = require('../../config');
const superagent = require('superagent');
const {
} = require('body-parser');

module.exports = {
    name: 'waifu',
    category: 'waifu',
    description: 'Random Waifu',
    usage: `${prefix}waifu`,
    perms: 'Send Messages',
    cooldown: 5,
    run: async (bot, message, args) => {

        const rating1 = 10
        const rating2 = Math.floor(Math.random() * rating1)
        var rating = rating2

        const decimals1 = 100
        const decimals2 = Math.floor(Math.random() * decimals1)
        var decimals = decimals2

        const compatibility1 = 100
        const compatibility2 = Math.floor(Math.random() * compatibility1)
        var compatibility = compatibility2

        const {
        } = require("../../Database/WaifuNameDB.json")

        let randW = Math.floor(Math.random() * Object.keys(waifuID).length)
        let randomWaifu = waifuID[randW]

        let embed2 = new MessageEmbed()
            .addField("Claims:", `${}`)
            .addField("Rating:", `${rating}.${decimals}/10 ⭐`)
            .setImage(`${randomWaifu.img_url}`, innerHeight = '500', innerWidth = '500')
            .setFooter(`| Powered by: @Twintails🎀 API `, ``)

        var mg = await;


        function messageReaction() {

            bot.on('messageReactionAdd', async (reaction, user) => {
                if ( await;
                if (reaction) await reaction.fetch()
                if ( return;
                if ( == "💖") {

                    let embed = new MessageEmbed()
                        .setDescription(`**${user.username} married ${randomWaifu.names}** 💕`)
                        .setFooter('Powered by: 🎀Twintails API')

        /*for (const [key, value] of Object.entries(waifuID)) {
            console.log(key, value.names)

Sorry, but we can’t spoonfeed.

You would have to insert your data into a table.

var mysql = require('mysql');

var con = mysql.createConnection({
  host: "localhost",
  user: "yourusername",
  password: "yourpassword",
  database: "mydb"

con.connect(function(err) {
  if (err) throw err;
  var sql = "INSERT INTO photos (image, discord_id) VALUES ('username', 'photo')";
  con.query(sql, function (err, result) {
    if (err) throw err;
    console.log("1 record inserted");

@HK420 I would grab a free DB from MongoDB Atlas. There are tones of tutorials to set it up with node and even specifically for discord.js using the Mongoose npm package. The free DB plan should be above and beyond what you need.

1 Like

This tutorial looks OK:

I haven’t had time to fully watch the video, so it may not be great.

MYSQL, that is though

If this bot is for a personal server only, I recommend using free database sites, such as MangoBD and/or Google Cloud (I recommend Google Cloud.) If this bot is intentionally for more than 100+ servers, a paid database would be better.

1 Like

Or you can just use the MySQL on your Glitch project.

I’ve never really tried it so I don’t have an opinion about it. :man_shrugging:

Should just be the same as any other mysql database.

Thanks so much!

1 Like

but Mysql starts with the same letter as MongoDB lol :slight_smile:.
EVE stack = Endb, VS Code, Eris just for fun

since when did we start putting text editor names in stack acronyms lol. I thought the N in MEN was nodejs not notepad++ image