code: def _update_offset(self, last_message):
          
          self.request.offset_id = last_message.id
          if self.reverse:
              # We want to skip the one we already have
              self.request.offset_id += 1
  
          if isinstance(self.request, functions.messages.SearchRequest):
              # Unlike getHistory and searchGlobal that use *offset* date,
              # this is *max* date. This means that doing a search in reverse
              # will break it. Since it's not really needed once we're going
              # (only for the first request), it's safe to just clear it off.
              self.request.max_date = None
          else:
              # getHistory and searchGlobal call it offset_date
              self.request.offset_date = last_message.date
  
          if isinstance(self.request, functions.messages.SearchGlobalRequest):
              self.request.offset_peer = last_message.input_chat
docs: After making the request, update its offset with the last message.