        (map-indexed (fn [num elem]
                       (assoc elem :position (inc num))))))
 
-(defn- comment-body [issue]
+(defn- comment-body
+  "Creates the comment body for an auto comment kicked off by an issue being opened or closed."
+  [issue]
   (str
    (if (= (:type issue) "pull request")
      "Thanks for your pull request!"

                     user name (:id result)))))

(defn repo-hooks
  "List hooks for an individual repository"
  [user name]
  (->>
   (hooks user name (gh-auth))
   (map (fn [h]
          {:url (get-in h [:config :url]) :id (:id h) :name (:name h)}))))

(defn list-repos
  []
  (let [all-repos (repos (assoc (gh-auth) :type "public" :all-pages true))
        filter-fn (if (hook-forks) identity (comp not :fork))]

         (filter filter-fn)
         (map (fn [repo] {:name (get! repo :name) :owner (get-in! repo [:owner :login])})))))

(defn- list-repos-with-hooks
  []
  (map #(assoc % :hooks (repo-hooks (:owner %) (:name %))) (list-repos)))

(defn all-hooks
  "List hooks by repository for public repositories owned by user."
  []
  (let [hook-id #(or (:url %) (:name %))]
    (->> (list-repos-with-hooks)
         (map #(assoc % :hooks (map hook-id (:hooks %)))))))

(defn delete-webhook
