code: def run(self):
          
          while self.should_run:
              try:
                  self.logger.debug('Sending heartbeat, seq ' + last_sequence)
                  self.ws.send(json.dumps({
                      'op': 1,
                      'd': last_sequence
                  }))
              except Exception as e:
                  self.logger.error(f'Got error in heartbeat: {str(e)}')
              finally:
                  elapsed = 0.0
                  while elapsed < self.interval and self.should_run:
                      time.sleep(self.TICK_INTERVAL)
                      elapsed += self.TICK_INTERVAL
docs: Runs the thread
  
          This method handles sending the heartbeat to the Discord websocket server, so the connection
          can remain open and the bot remain online for those commands that require it to be.
  
          Args:
              None