diff options
author | Adrian Kummerlaender | 2016-03-16 20:58:51 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2016-03-16 21:00:46 +0100 |
commit | 05fa1103796cdbda30afb7be1e569674d6076f87 (patch) | |
tree | 85c80b6addf9094d72dbc8de8a18125dfbb8444a | |
parent | e5a1beddb41bd5341baf5237e331e472db94a23a (diff) | |
download | Telebot-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
-rw-r--r-- | example/guess.scm | 10 |
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 |