This commit is contained in:
Roman Volosovskyi 2017-05-01 11:47:15 +03:00
parent 6a20f9040c
commit 1d532fc820
1 changed files with 5 additions and 4 deletions

View File

@ -203,8 +203,9 @@
(u/side-effect!
(fn [_ [_ {:keys [chat-id] :as params} {:keys [result] :as data}]]
(let [{:keys [returned context]} result
{:keys [markup text-message]} returned
{:keys [log-messages update-db default-db]} context]
{:keys [markup text-message err]} returned
{:keys [log-messages update-db default-db]} context
content (or err text-message)]
(when update-db
(dispatch [:update-bot-db {:bot chat-id
:db update-db}]))
@ -223,10 +224,10 @@
:chat-id chat-id
:from chat-id
:to "me"}]))))
(when text-message
(when content
(dispatch [:received-message
{:message-id (random/id)
:content (str text-message)
:content (str content)
:content-type text-content-type
:outgoing false
:chat-id chat-id