|
|
@@ -29,7 +29,6 @@
|
|
|
:telegram-reply-keyboard-markup
|
|
|
:telegram-reply-keyboard-hide
|
|
|
:telegram-force-reply
|
|
|
- :send-response
|
|
|
:bot-send-message))
|
|
|
(in-package :chatikbot.telegram)
|
|
|
|
|
|
@@ -249,21 +248,35 @@
|
|
|
|
|
|
;; Simplified interface
|
|
|
;;
|
|
|
-(defun send-response (chat-id response &optional reply-id)
|
|
|
- (if (consp response)
|
|
|
- (if (keywordp (car response))
|
|
|
- (case (car response)
|
|
|
- (:text (telegram-send-message chat-id (cdr response) :reply-to reply-id))
|
|
|
- (:voice (telegram-send-voice chat-id (cdr response) :reply-to reply-id))
|
|
|
- (:sticker (telegram-send-sticker chat-id (cdr response) :reply-to reply-id)))
|
|
|
- (mapc #'(lambda (r) (send-response chat-id r reply-id)) response))
|
|
|
- (telegram-send-message chat-id response :reply-to reply-id)))
|
|
|
-
|
|
|
-(defun bot-send-message (chat-id text &key parse-mode disable-web-preview disable-notification reply-to reply-markup)
|
|
|
- (handler-case (telegram-send-message chat-id text :parse-mode parse-mode
|
|
|
- :disable-web-preview disable-web-preview
|
|
|
- :disable-notification disable-notification
|
|
|
- :reply-to reply-to
|
|
|
- :reply-markup reply-markup)
|
|
|
+(defun bot-send-message (chat-id message &key parse-mode disable-web-preview disable-notification reply-to reply-markup duration)
|
|
|
+ (handler-case (if (consp message)
|
|
|
+ (if (keywordp (car message))
|
|
|
+ (case (car message)
|
|
|
+ (:text (telegram-send-message chat-id (cdr message)
|
|
|
+ :parse-mode parse-mode
|
|
|
+ :disable-web-preview disable-web-preview
|
|
|
+ :disable-notification disable-notification
|
|
|
+ :reply-to reply-to
|
|
|
+ :reply-markup reply-markup))
|
|
|
+ (:voice (telegram-send-voice chat-id (cdr message)
|
|
|
+ :duration duration
|
|
|
+ :reply-to reply-to
|
|
|
+ :reply-markup reply-markup))
|
|
|
+ (:sticker (telegram-send-sticker chat-id (cdr message)
|
|
|
+ :reply-to reply-to
|
|
|
+ :reply-markup reply-markup)))
|
|
|
+ (mapc #'(lambda (m) (bot-send-message chat-id m
|
|
|
+ :parse-mode parse-mode
|
|
|
+ :disable-web-preview disable-web-preview
|
|
|
+ :disable-notification disable-notification
|
|
|
+ :reply-to reply-to
|
|
|
+ :reply-markup reply-markup
|
|
|
+ :duration duration)) message))
|
|
|
+ (telegram-send-message chat-id message
|
|
|
+ :parse-mode parse-mode
|
|
|
+ :disable-web-preview disable-web-preview
|
|
|
+ :disable-notification disable-notification
|
|
|
+ :reply-to reply-to
|
|
|
+ :reply-markup reply-markup))
|
|
|
(error (e)
|
|
|
(log:error e))))
|