Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

84
Vistas
Discord.js Command out right refuses to work

I want to make a command that is set to enabled by default and after the user uses it once it sets to disabled by default. Also that the command is disabled per-user. But when executing this code it out right refuses to work and i get no error in the terminal. Any help would be appriciated!

Heres my Code so far:

const { Client, Message, MessageEmbed } = require('discord.js');
const { QuickDB } = require('quick.db');
const db = new QuickDB();

module.exports = {
    name: 'alert',
    /** 
     * @param {Client} client 
     * @param {Message} message 
     * @param {String[]} args 
     */
    run: async(client, message, args) => {
        let embed = new MessageEmbed()
                .setTitle("🎉It seems you are new here!")
                .setDescription("Use `R2 set help` to get help setting up your profile!\nUse `R2 help` to see all commands catagorized.\n\n**Pro Tip:🤫** Use `R2 help` followed by the command name for more information!")
                .setColor("#2F3136")
                .setTimestamp()
        if(db.get(`${message.author.id}alert_`) !== true){
            return;
        } else if(db.get(`${message.author.id}alert_`) !== false){
            message.channel.send({embeds: [embed]})
            db.set(`${message.author.id}alert_`, false)
            }
        }
    }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

const { QuickDB } = require("quick.db");
const db = new QuickDB();

run: async(client, message, args) => {
    if(await db.get(`${message.author.id}.alert` == true)) return;
    
    // Message Embed Code

    message.channel.send( . . . );

    await db.set(`${message.author.id}.alert`, true);
}

Should work for you, it seems like quick.db requires a dot between values, as it has a JSON structure. You can view the documentation for it here.

https://quickdb.js.org/

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda