#Read below
12 messages · Page 1 of 1 (latest)
- 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!
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) {
},
};
How you access the database completely depends on what database you're using
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;
Read the Sequelize guide, it will help you a lot:
https://sequelize.org/docs/v6/getting-started/
ok ty