How to get a list of particular data from quickdb?

49 views Asked by At

I'm trying to make list command to list the stored data for this code , I tried a lot but it doesn't work for me

run: async (client, message, args) => {
message.delete({ timeout: 1000 })
if (!client.config.bowner.includes(message.author.id)) return;
if (!args[0]) {
  return message.reply(
    new discord.MessageEmbed({
      color: client.embed.cf,
      description: "Target user not mentioned!",
    })
  );
}
const target =
  message.mentions.members.first() ||
  message.guild.members.guild.cache.get[0];

if (!args[1]) return message.reply("Add or Remove")

if (args[1] === "add") {
  db.push("noprefix" + target.id)
  return message.reply("Done").then(m => m.delete({ timeout: 3000 }))
} else if (args[1] === 'remove') {
  db.delete("noprefix" + target.id)
  return message.reply("Done").then(m => m.delete({ timeout: 3000 }))
}
1

There are 1 answers

0
Neenhila On

In your database there's no exact noprefix db. There's always something next to noprefix as you said, + target id. So you can collect noprefix things in your one data as noprefix and make it an array, then push every noprefix things into it. Then you can use it.