Otann/morse

Update handler

Closed this issue · 1 comments

Hi,

I want to use a feature of the api which doesn't have an explicit handler, luckily I can just:

(h/update-fn [:chosen_inline_result]
  (fn [{:keys [inline_message_id query]}]
    (println "Registering " inline_message_id "\n" query)
    (k/assoc-in db [inline_message_id] (register-question query))))

But then I noticed my function still got called on normal messages. I propose therefore a change:

(let [data (get-in update path)]

    (if-let [data (get-in update path)]

Hopefully you agree, if I have overlooked something let me know.

Sander

Fixed in 895271d