Skip to content

Commit

Permalink
Unify duration/delay name to timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
feychou committed Jul 5, 2017
1 parent ab905ef commit 32b349a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/facebook_example/bot.clj
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,20 @@
(match [reply]

; The bot wants to send a message (text, images, videos etc.) after n milliseconds
[{:message message :delay delay}]
[{:message message :timeout timeout}]
(do
(Thread/sleep delay)
(Thread/sleep timeout)
(facebook/send-message sender-id message))

; The bot wants to send a message (text, images, videos etc.)
[{:message message}]
(facebook/send-message sender-id message)

; The bot wants to type on for n milliseconds
[{:action action :duration duration}]
[{:action action :timeout timeout}]
(do
(facebook/send-sender-action sender-id action)
(Thread/sleep duration))
(Thread/sleep timeout))

; The bot wants to perform an action (mark_seen or typing_off)
[{:action action}]
Expand Down
2 changes: 1 addition & 1 deletion src/facebook_example/reaction.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[{:message (templates/text-message message-text)}])

(defn welcome []
[{:action "typing_on" :duration 3000}
[{:action "typing_on" :timeout 3000}
{:message (templates/text-message "Welcome, fellow lemming =)")}
{:message (templates/image-message "https://upload.wikimedia.org/wikipedia/commons/e/ef/Tunturisopuli_Lemmus_Lemmus.jpg")}])

Expand Down

0 comments on commit 32b349a

Please sign in to comment.