title: if update.message.parse_entities(types == links_list) >>> NameError: name 'types' is not defined (Python-Telegram-Bot)
body: <p>sorry for my bad English :)</p>
  <p>i wrote a telegram bot with PTB</p>
  <p>I want to check if there is a link in the message or not</p>
  <p>this is my code :</p>
  <pre><code>from telegram.ext import Updater, MessageHandler, CommandHandler, Filters
  from telegram import MessageEntity
  
  TOKEN = &quot;MY TOKEN&quot;
  
  updater = Updater(TOKEN,use_context=True)
  def test(update, context):       #&lt;&lt;&lt;&lt;
      cid = update.message.chat_id
      foo = update.message.parse_entities
      links = [MessageEntity.TEXT_LINK,MessageEntity.URL]
      print(foo.type)
      if foo(type == links):
          context.bot.delete_message(cid,update.message.message_id)
  
  #Handlers
  dispatcher = updater.dispatcher
  dispatcher.add_handler(MessageHandler(Filters.text,test))
  
  
  #Polling
  updater.start_polling()
  </code></pre>
  <p>I run this and I send a normal message to the robot but i get this error in terminal :</p>
  <pre><code>No error handlers are registered, logging exception.
  Traceback (most recent call last):
    File &quot;/home/moein/.local/lib/python3.8/site-packages/telegram/ext/dispatcher.py&quot;, line 340, in process_update
      handler.handle_update(update, self, check, context)
    File &quot;/home/moein/.local/lib/python3.8/site-packages/telegram/ext/handler.py&quot;, line 119, in handle_update
      return self.callback(update, context)
    File &quot;test.py&quot;, line 12, in test
      if foo(types == links):
  NameError: name 'types' is not defined
  </code></pre>
  <p>What is the problem with this code?</p>
  <p>Did I write this incorrectly?</p>
  <p>If yes, what is the correct code?</p>