code: def get_message_id(message):
      
      if message is None:
          return None
  
      if isinstance(message, int):
          return message
  
      try:
          if message.SUBCLASS_OF_ID == 0x790009e3:
              # hex(crc32(b'Message')) = 0x790009e3
              return message.id
      except AttributeError:
          pass
  
      raise TypeError('Invalid message type: {}'.format(type(message)))
docs: Similar to :meth:`get_input_peer`, but for message IDs.