Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

79
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!