aboutsummaryrefslogtreecommitdiff
path: root/telebot.scm
diff options
context:
space:
mode:
Diffstat (limited to 'telebot.scm')
-rw-r--r--telebot.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/telebot.scm b/telebot.scm
index 5e95e1d..9465e52 100644
--- a/telebot.scm
+++ b/telebot.scm
@@ -12,6 +12,9 @@
sendChatAction
getUserProfilePhotos
getFile
+ is-message?
+ is-inline_query?
+ is-chosen_inline_result?
pollUpdates)
(import chicken scheme)
(use srfi-1)
@@ -156,6 +159,14 @@
;;; framework
+ (define (update-predicate type)
+ (lambda (update)
+ (not (equal? #f (alist-ref type update)))))
+
+ (define is-message? (update-predicate 'message))
+ (define is-inline_query? (update-predicate 'inline_query))
+ (define is-chosen_inline_result? (update-predicate 'chosen_inline_result))
+
(define (pollUpdates token handler)
(let ((offset 0))
(do-forever