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

144
Visualizações
I want to make a whitelisted command using quick.db

I want to make a whitelist command using quickDB, so that if I do

!whitelist @user/userid

Then it stores data in the database

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Please note: This platform is to help you with your code/errors you're facing and not to spoon-feed you.

Now coming to your question

const db = require('quick.db')
client.on("messageCreate", async message => {
    if (message.content.startsWith('!blacklist')) {

        let mentions = message.mentions.users.first()
        if (!mentions) {
            return message.reply({ content: `Please mention a user!` })
        } else {
            await db.push(`_blacklisted_`, mentions.id)//Including the mentioned member into the blacklisted list
            message.channel.send({ content: `Blacklisted **${mentions.tag}**` })
        }
    }
    if (message.content.startsWith('!whitelist')) {
        let mentions = message.mentions.users.first()
        if (!mentions) {
            return message.reply({ content: `Please mention a user!` })
        } else {
            let check_blacklist = await db.get(`_blacklisted_`, [])
            let index = check_blacklist.indexOf(mentions.id)
            if (index > -1) {
                check_blacklist.splice(index, 1)//remove the mentioned user from the blacklisted array
                await db.set(`_blacklisted_`, check_blacklist) //Setting the new list
                message.reply({ content: `Whitelisted ${mentions.tag}` })
            } else {
                message.reply({ content: `${mentions.username} is not blacklisted` })
            }

        }

    }
})

Do read the docs

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