pooling started, but not working
Closed this issue · 3 comments
feknall commented
I started pooling and I set the timeout to 300 and I start communicating with my Bot in Telegram.
but nothing happens.
(morse.handlers/defhandler bot-api
; Each bot has to handle /start and /help commands.
; This could be done in form of a function:
(morse.handlers/command-fn "start" (fn [{{id :id :as chat} :chat}]
(println "Bot joined new chat: " chat)
(morse.api/send-text token id "Welcome!")))
; You can use short syntax for same purposes
; Destructuring works same way as in function above
(morse.handlers/command "help" {{id :id :as chat} :chat}
(println "Help was requested in " chat)
(morse.api/send-text token id "Help is on the way"))
; Handlers will be applied until there are any of those
; returns non-nil result processing update.
; Note that sending stuff to the user returns non-nil
; response from Telegram API.
; So match-all catch-through case would look something like this:
(morse.handlers/message message (println "Intercepted message:" message)))
...
(def channelx (morse.polling/start token bot-api {:timeout 300}))
Otann commented
That's interesting, thank you for reporting it.
What does your log say? Are you sure you have the correct token?
feknall commented
I think it was my fault.
I asked someone and he tolled me what I want to do is not possible. He tolled something like that you need https. I tried this library with chat-id and worked.
Otann commented
I'll close this one then