title: AttributeError: 'HashMap' object has no attribute 'keys'
body: <pre><code>    import discord
      import requests
      import json
      import random
      from replit import db
  
  
      client = discord.Client()
  
      sad_words = [&quot;sad&quot;, &quot;depressed&quot; , &quot;unhappy&quot;, &quot;angry&quot; , &quot;miserable&quot; , &quot;depressing&quot;]
  
      starter_encouragements = [ &quot;Cheer up!&quot;, &quot;Hang in there.&quot; , &quot;You are a great person / 
       bot!&quot;]
  
      def get_quote():
         response = requests.get(&quot;https://zenquotes.io/api/random&quot;)
         json_data = json.loads(response.text)
         quote = json_data[0]['q'] + &quot;-&quot; + json_data[0]['a']
         return(quote)
  
      def update_encouragements(encouraging_message):
          if &quot;encouragements&quot; in db.keys():
             encouragements = db[&quot;encouragements&quot;]
             encouragements.appen(encouraging_message)
              db[&quot;encouragements&quot;] = encouragements
            else:
                db[&quot;encouragements&quot;] = [encouraging_message]
  
         def delete_encouragement(index):
            encouragements = db[&quot;encouragements&quot;]
        if len(encouragements) &gt; index:
           del encouragements[index]
          db[&quot;encouragements&quot;] = encouragements
  
     TOKEN = XXX
  
            @client.event
       async def on_ready():
         print ('we have logged in as {0.user}'.format(client))
  
  
    @client.event
        async def on_message(message):
      if message.author == client.user:
          return
  
      msg = message.content
  
      if msg.startswith('inspire'):
          quote = get_quote()
          await message.channel.send(quote)
  
      
      options = starter_encouragements
      if &quot;encouragements&quot; in db.keys():
            options = options + db[&quot;encouragements&quot;]
  
      if any(word in msg for word in sad_words) :
          await message.channel.send(random.choice(options))
  
      if msg.startswith(&quot;$new&quot;):
          encouraging_message = msg.split(&quot;$new &quot; ,1)[1]
          update_encouragements(encouraging_message)
          await message.channel.send(&quot;New encouraging message added.&quot;)
  
      if msg.startswith(&quot;del&quot;):
          encouragements = []
          if &quot;encouragements&quot;   in db.keys():
              index = msg.split(&quot;$del&quot; , 1)[1]
              delete_encouragement(index)
              encouragements = db[&quot;encouragements&quot;]
          await message.channel.send(encouragements)
  
  
          client.run(TOKEN)
  </code></pre>
  <p>'''
  This a discord bot , the error i am getting is 'Hashmap' object has no attribute 'keys'.It's an attribute error. I hope i could get some help. (About me , just a beginner trying new things bumped into this and loved it ) pls drop some tips too for making more efficient bots '''</p>
  <p>error is written below</p>
  <p>--------&gt;error: ' if &quot;encouragements&quot; in db.keys(): '
  ' AttributeError: 'Hashmap' object has no attribute 'keys' '</p>