title: How to search for Specific item in User's Quick.db Inventory
body: <p>Pretty much, I'm having difficulty being able to find a role in a user's Quick.db inventory. I'd like to do this to: allow them to only buy a role once; allow them to equip an owned role only <em>if</em> it's found in their inventory. Problem is that the user is able to buy a role more than once, and able to equip a role even if it's not owned. I believe the line I'm having trouble with is <code>if(db.has(message.author.id + '.items' + 'hot rod red'))</code> (possibly because I'm searching for a role and not a plain text item?), but it could be something else.</p>
  <p>I'm completely lost and run out of ideas at this point, any help is appreciated!</p>
  <p><strong>Code for Equipping a Role:</strong></p>
  <pre><code>    let user = message.guild.members.cache.get(message.author.id)
      let items = await db.fetch(message.author.id);
      if(items === null) items = &quot;Nothing&quot;
      let author = db.get(`items_${message.guild.id}_${user.id}`)
  
  
    if (args[0] == 'red') {
      let rejectEmbed = new Discord.MessageEmbed()
      .setDescription('You do not own this role!');
      
      if(db.has(message.author.id + '.items' + 'hot rod red')){
        if (message.member.roles.cache.some(role =&gt; role.name === 'hot rod red')) {
          let embed = new Discord.MessageEmbed().setDescription('You already have this role!');
          return message.channel.send(embed); }
         
      else {
          await message.guild.members.cache.get(user.id).roles.add('733373020491481219');
            let embed = new Discord.MessageEmbed().setDescription(`You now have the ${message.guild.roles.cache.get('733373020491481219')} role!`);
            message.channel.send(embed);
            user.roles.remove(user.roles.highest); 
          } 
        
        } else return message.channel.send(rejectEmbed)            
  }
  
  
  </code></pre>
  <p><strong>Code for Buy Command:</strong></p>
  <pre><code>        let Embed = new Discord.MessageEmbed()
              .setColor(&quot;#FFFFFF&quot;)
              .setDescription(`&gt; :no_entry_sign:  You need 20,000 credits to purchase ${message.guild.roles.cache.get('733373020491481219')}`);
              if (message.member.roles.cache.some(role =&gt; role.name === &quot;level 25&quot;) ||(message.member.roles.cache.some(role =&gt; role.name === &quot;frequent flyers&quot;))){
       
          if (console.log(db.has(message.author.id, 'hot rod red'))){
          let EmbedError = new Discord.MessageEmbed()     
          .setColor('#FFFFFF')
          .setDescription(`:no_entry_sign: You already own ${message.guild.roles.cache.get('733373020491481219')} !`);
                 return message.channel.send(EmbedError)
      
              }else
                  if (amount &lt; 20000) return message.channel.send(Embed)
                  let Embed3 = new Discord.MessageEmbed()
                  .setColor(&quot;#FFFFFF&quot;)
                  .setDescription(`:white_check_mark: You bought ${message.guild.roles.cache.get('733373020491481219')} for 20,000 credits!`);
                  message.channel.send(Embed3)
                  db.subtract(`money_${message.guild.id}_${user.id}`, 20000)
  
          db.push(message.author.id, `${message.guild.roles.cache.get('733373020491481219')}`);
          db.fetch(`hot_rod_red${message.guild.id}_${user.id}`);
          db.set(`hot_rod_red_${message.guild.id}_${user.id}`, true)
          
          }else {return message.channel.send('You do not have the required level to buy this role!')}
      }
  </code></pre>