   (:require [clj-http.client :as client]
             [clojure.data.json :as json]
             [gniazdo.core :as ws]))
+
 
 (def the-token (atom nil))
 (def the-gateway (atom nil))
 (def the-socket (atom nil))
 (def the-ready (atom nil))
 (def the-keepalive (atom nil))
+
 
 (defn obtain-token [email password]
   (let [response (client/post "https://discordapp.com/api/auth/login"

      (get (json/read-str (:body response)) "token")
      (println "Token obtention failed with status code " status))))

(defn obtain-gateway [token]
  (let [response (client/get "https://discordapp.com/api/gateway"
                             {:headers {:authorization token}})

      (get (json/read-str (:body response)) "url")
      (println "Gateway obtention failed with status code " status))))


(defn connect [email password]
  (disconnect)
  (reset! the-keepalive true)
  (reset! the-token (obtain-token email password))
  (reset! the-gateway (obtain-gateway @the-token))
  (reset! the-socket
          (ws/connect 
            @the-gateway
            :on-receive #(do 
