summaryrefslogtreecommitdiff
path: root/src/tg/send-animation.lisp
blob: 1fd7a89631cdbee9b76fa90eba49fc6c0fa6978d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
;; SPDX-License-Identifier: EUPL-1.2
;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs <perkontevs@gmail.com>
(defpackage :ukkoclot/tg/send-animation
  (:use
   :c2cl
   :ukkoclot/tg/force-reply
   :ukkoclot/tg/inline-keyboard-markup
   :ukkoclot/tg/message
   :ukkoclot/tg/message-entity
   :ukkoclot/tg/method-macros
   :ukkoclot/tg/parse-mode
   :ukkoclot/tg/reply-keyboard-markup
   :ukkoclot/tg/reply-keyboard-remove
   :ukkoclot/tg/reply-parameters
   :ukkoclot/tg/suggested-post-parameters)
  (:export :reply-animation :send-animation))
(in-package :ukkoclot/tg/send-animation)

(define-tg-method (send-animation message)
  (business-connection-id (or string null) nil)
  (chat-id (or integer string))
  (message-thread-id (or integer null) nil)
  (direct-messages-topic-id (or integer null) nil)
  (animation (or pathname string))
  (duration (or integer null) nil)
  (width (or integer null) nil)
  (height (or integer null) nil)
  (thumbnail (or pathname string null) nil)
  (caption (or string null) nil)
  (parse-mode (or parse-mode null) nil)
  (caption-entities (or (array message-entity) null) nil)
  (show-caption-above-media boolean nil)
  (has-spoiler boolean nil)
  (disable-notification boolean nil)
  (protect-content boolean nil)
  (allow-paid-broadcast boolean nil)
  (message-effect-id (or string null) nil)
  (suggested-post-parameters (or suggested-post-parameters null) nil)
  (reply-parameters (or reply-parameters null) nil)
  (reply-markup (or inline-keyboard-markup reply-keyboard-markup reply-keyboard-remove force-reply null) nil))

;; TODO: Some kind of caching for files?
(defun reply-animation (bot msg animation &key allow-sending-without-reply text parse-mode caption-above)
  (send-animation bot
                  :chat-id (message-chat-id msg)
                  :animation animation
                  :caption text
                  :parse-mode parse-mode
                  :show-caption-above-media caption-above
                  :reply-parameters
                  (make-reply-parameters
                   :allow-sending-without-reply allow-sending-without-reply
                   :message-id (message-id msg)
                   :chat-id (message-chat-id msg))))