Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

81
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda