Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update handler #38

Closed
Sandarr95 opened this issue Mar 21, 2018 · 1 comment
Closed

Update handler #38

Sandarr95 opened this issue Mar 21, 2018 · 1 comment

Comments

@Sandarr95
Copy link

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

@Sandarr95
Copy link
Author

Fixed in 895271d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant