#Read below

12 messages · Page 1 of 1 (latest)

glad lance
#

Can someone explain me how I can combine my discord js ping command with a db. I create a dbconnection event but now I don't know what I need else. Ty for all hints

outer ridgeBOT
#
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
glad lance
#

I know that I can write some stuff with Insert Into in my db

#

the db is created

#

and I write a connectiondb event

#

but knwo I stucked

#
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('test')
        .setDescription('Verify ur COC Tag!')
        .addStringOption(option =>
        option.setName('tag')
            .setDescription('Enter your COC tag here!')
            .setRequired(true)),
    async execute(interaction) {
        
        
    },
};

hallow slate
#

How you access the database completely depends on what database you're using

glad lance
#

the execute part I want. I can't write the sql inside this this doesn't work

#
const { Sequelize } = require('sequelize');
const dotenv = require('dotenv');

const sequelize = new Sequelize({
 dialect: 'sqlite',
 storage: process.env.DB_DATABASE || ''
});

(async () => {
    try {
        await sequelize.authenticate();
        console.log('The connection to the database has been successfully established.');
    } catch (error) {
        console.error('The connection to the database has failed:', error);
    } finally {
        sequelize.close();
    }
})();


module.exports = sequelize;
hallow slate
glad lance
#

ok ty