0

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 }))
}
Adriaan
  • 17,741
  • 7
  • 42
  • 75
  • So is there any specific error that you are getting with this issue? Or attempt at making a simple reproducible example? https://stackoverflow.com/help/minimal-reproducible-example – treckstar May 23 '22 at 12:21
  • I'm using this code `let noprefix = db.get('noprefix') if(!owners) return message.channel.send('There are no users to show!') else message.channel.send('The owners are ' + noprefix.join(' and '))` but it always show's their is no user to show, if i remove that part than their is a error at join – Arya Sharma May 23 '22 at 15:06

1 Answers1

0

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.

Neenhila
  • 187
  • 2
  • 9