aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerländer2018-04-22 13:49:48 +0200
committerGitHub2018-04-22 13:49:48 +0200
commite8e5c001d462f071d4cc1803bd749a6f667e22ca (patch)
treebff63d87051bb7787f194c40fef4d0e91ead8962
parent675add4136bb4ac7eed0ec347373a41f14f5e567 (diff)
parent94f572847c844608adf43bbac2bfc52838fc226b (diff)
downloadTelebot-e8e5c001d462f071d4cc1803bd749a6f667e22ca.tar
Telebot-e8e5c001d462f071d4cc1803bd749a6f667e22ca.tar.gz
Telebot-e8e5c001d462f071d4cc1803bd749a6f667e22ca.tar.bz2
Telebot-e8e5c001d462f071d4cc1803bd749a6f667e22ca.tar.lz
Telebot-e8e5c001d462f071d4cc1803bd749a6f667e22ca.tar.xz
Telebot-e8e5c001d462f071d4cc1803bd749a6f667e22ca.tar.zst
Telebot-e8e5c001d462f071d4cc1803bd749a6f667e22ca.zip
Merge pull request #1 from recumbentbirder/update-checks
Update checks
-rw-r--r--telebot.scm16
1 files changed, 12 insertions, 4 deletions
diff --git a/telebot.scm b/telebot.scm
index 34fc466..3970588 100644
--- a/telebot.scm
+++ b/telebot.scm
@@ -3,6 +3,7 @@
getUpdates
sendMessage
forwardMessage
+ resolve-query
sendPhoto
sendAudio
sendDocument
@@ -24,8 +25,11 @@
answerInlineQuery
;;; framework
is-message?
+ is-edited_message?
is-inline_query?
is-chosen_inline_result?
+ is-text?
+ is-location?
poll-updates
make-conversation-manager)
(import chicken scheme)
@@ -245,11 +249,15 @@
(define (update-predicate type)
(lambda (update)
- (not (equal? #f (alist-ref type update)))))
+ (not (equal? #f (resolve-query 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 is-message? (update-predicate '(message)))
+ (define is-edited_message? (update-predicate '(edited_message)))
+ (define is-inline_query? (update-predicate '(inline_query)))
+ (define is-chosen_inline_result? (update-predicate '(chosen_inline_result)))
+
+ (define is-text? (update-predicate '(message text)))
+ (define is-location? (update-predicate '(message location)))
(define (poll-updates token handler)
(let ((offset 0))