aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorAdrian Kummerlaender2016-03-16 20:58:51 +0100
committerAdrian Kummerlaender2016-03-16 21:00:46 +0100
commit05fa1103796cdbda30afb7be1e569674d6076f87 (patch)
tree85c80b6addf9094d72dbc8de8a18125dfbb8444a /example
parente5a1beddb41bd5341baf5237e331e472db94a23a (diff)
downloadTelebot-05fa1103796cdbda30afb7be1e569674d6076f87.tar
Telebot-05fa1103796cdbda30afb7be1e569674d6076f87.tar.gz
Telebot-05fa1103796cdbda30afb7be1e569674d6076f87.tar.bz2
Telebot-05fa1103796cdbda30afb7be1e569674d6076f87.tar.lz
Telebot-05fa1103796cdbda30afb7be1e569674d6076f87.tar.xz
Telebot-05fa1103796cdbda30afb7be1e569674d6076f87.tar.zst
Telebot-05fa1103796cdbda30afb7be1e569674d6076f87.zip
Move _guess_ example greeting to conversation closure constructor
Diffstat (limited to 'example')
-rw-r--r--example/guess.scm10
1 files changed, 5 insertions, 5 deletions
diff --git a/example/guess.scm b/example/guess.scm
index 2215380..e1b419c 100644
--- a/example/guess.scm
+++ b/example/guess.scm
@@ -22,6 +22,8 @@
(define (make-conversation chat_id)
(let ((chat_id chat_id)
(answer (random 100)))
+ (send chat_id
+ "Hi there! I just generated a random number for you to guess!")
(lambda (text)
(let ((guess (string->number text)))
(if (number? guess)
@@ -39,11 +41,9 @@
(print chat_id " -> \"" text "\"")
(if (hash-table-exists? conversations chat_id)
((hash-table-ref conversations chat_id) text)
- (begin (hash-table-set! conversations
- chat_id
- (make-conversation chat_id))
- (send chat_id
- "Hi there! I just generated a random number for you to guess!")))))
+ (hash-table-set! conversations
+ chat_id
+ (make-conversation chat_id)))))
(randomize)
(telebot:pollUpdates token