From 910954b4a71c45e680ed834a45d6cfecbdeb928c Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 16 Mar 2016 23:01:20 +0100 Subject: Implement conversation-manager pattern framework function The _conversation-manager_ pattern previously tested in the _guess_ example game should be useful for other kinds of use cases and as such was moved into the module. `make-conversation-manager` maintains an internal hash table of per-conversation (i.e. chat-ids) closures constructed by the provided constructor function. Thus bot implementations such as the _guess_ game example only need to instantiate a conversation-manager, call it via e.g. `poll-updates` and implement the actual conversation logic in a custom conversation closure. Telebot's framework function names are now consistently separated by minuses instead of capital letters. --- example/echo.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'example/echo.scm') diff --git a/example/echo.scm b/example/echo.scm index 2e190a7..90d0af5 100644 --- a/example/echo.scm +++ b/example/echo.scm @@ -25,8 +25,8 @@ chat_id: chat_id text: text))) -(telebot:pollUpdates token - (lambda (u) - (if (telebot:is-message? u) - (begin (print-message u) - (echo-message u))))) +(telebot:poll-updates token + (lambda (u) + (if (telebot:is-message? u) + (begin (print-message u) + (echo-message u))))) -- cgit v1.2.3