code: def _reset_connection_attributes(self):
          
          self.connection = None
          self.encoding = None
          self._autojoin_channels = []
          self._reconnect_attempts = 0
docs: Reset connection attributes.