 
 (defn connect
   ([token functions]
-    (connect token functions default-log-events? default-log-function default-max-text-message-size))
+    (connect token functions default-log-events? default-log-function default-max-text-message-size false))
   ([token functions log-events?]
-    (connect token functions log-events? default-log-function default-max-text-message-size))
+    (connect token functions log-events? default-log-function default-max-text-message-size false))
   ([token functions log-events? max-text-message-size]
-    (connect token functions log-events? default-log-function max-text-message-size))
+    (connect token functions log-events? default-log-function max-text-message-size false))
   ([token functions log-events? log-function max-text-message-size]  
-    (disconnect)
+    (connect functions log-events? log-function max-text-message-size false))
+  ([token functions log-events? log-function max-text-message-size reconnecting?]
+    (if reconnecting? (do 
+                        (disconnect)
+                        (Thread/sleep 5000)))
     (reset! the-keepalive true)
     (reset! the-token (str "Bot " token))
     (reset! the-gateway (str

                               (if (not (nil? type)) (doseq [afunction (get functions type (get functions "ALL_OTHER" []))]
                                                       (afunction type data)))))))
    (.start (Thread. (fn []
                       (try
                         (while @the-keepalive
                           (if (nil? @the-heartbeat-interval)
                             (Thread/sleep 100)
                             (do

                               )))
                         (catch Exception e (do
                                              (log-function "Caught exception: " (.getMessage e))
                                              (reset! the-keepalive false)
                                              ))))))
    (Thread/sleep 1000)
    (ws/send-msg @the-socket (json/write-str {:op 2, :d {"token" @the-token
