From d72113d8edd102168c98131f1f93413ed48435a6 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sun, 12 Oct 2025 15:26:39 +0300 Subject: Add Animation and PhotoSize types --- src/tg-types.lisp | 2 ++ src/tg-types/animation.lisp | 30 ++++++++++++++++++++++++++++++ src/tg-types/message.lisp | 26 ++++++++++++++++---------- src/tg-types/photo-size.lisp | 22 ++++++++++++++++++++++ 4 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 src/tg-types/animation.lisp create mode 100644 src/tg-types/photo-size.lisp (limited to 'src') diff --git a/src/tg-types.lisp b/src/tg-types.lisp index 6a830b6..ba3ec3b 100644 --- a/src/tg-types.lisp +++ b/src/tg-types.lisp @@ -3,6 +3,7 @@ (uiop:define-package :ukkoclot/tg-types (:use) (:use-reexport + :ukkoclot/tg-types/animation :ukkoclot/tg-types/bot-name :ukkoclot/tg-types/callback-query :ukkoclot/tg-types/chat @@ -17,6 +18,7 @@ :ukkoclot/tg-types/link-preview-options :ukkoclot/tg-types/message :ukkoclot/tg-types/message-entity + :ukkoclot/tg-types/photo-size :ukkoclot/tg-types/reply-keyboard-markup :ukkoclot/tg-types/reply-keyboard-remove :ukkoclot/tg-types/reply-parameters diff --git a/src/tg-types/animation.lisp b/src/tg-types/animation.lisp new file mode 100644 index 0000000..421dcc7 --- /dev/null +++ b/src/tg-types/animation.lisp @@ -0,0 +1,30 @@ +;; SPDX-License-Identifier: EUPL-1.2 +;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs +(defpackage :ukkoclot/tg-types/animation + (:use :c2cl :ukkoclot/tg-types/macros :ukkoclot/tg-types/photo-size) + (:export + #:animation + #:make-animation + #:animation-p + #:copy-animation + #:animation-file-id + #:animation-file-unique-id + #:animation-width + #:animation-height + #:animation-duration + #:animation-thumbnail + #:animation-file-name + #:animation-mime-type + #:animation-file-size)) +(in-package :ukkoclot/tg-types/animation) + +(define-tg-type animation + (file-id string) + (file-unique-id string) + (width integer) + (height integer) + (duration integer) + (thumbnail (or photo-size null) nil) + (file-name (or string null) nil) + (mime-type (or string null) nil) + (file-size (or integer null) nil)) diff --git a/src/tg-types/message.lisp b/src/tg-types/message.lisp index 028379f..c402af2 100644 --- a/src/tg-types/message.lisp +++ b/src/tg-types/message.lisp @@ -1,12 +1,19 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/tg-types/message - (:use :c2cl :ukkoclot/tg-types/macros - + (:use + :c2cl + :ukkoclot/tg-types/animation :ukkoclot/tg-types/chat + :ukkoclot/tg-types/macros :ukkoclot/tg-types/message-entity + :ukkoclot/tg-types/photo-size :ukkoclot/tg-types/user) (:export + #:message-chat-id + #:message-thread-id + #:message-id + #:message #:make-message #:message-p @@ -34,11 +41,14 @@ #:message-text #:message-entities #:message-effect-id + #:message-animation + #:message-photo #:message-caption #:message-show-caption-above-media #:message-has-media-spoiler #:message-new-chat-members #:message-new-chat-title + #:message-new-chat-photo #:message-delete-chat-photo #:message-group-chat-created #:message-supergroup-chat-created @@ -46,11 +56,7 @@ #:message-migrate-to-chat-id #:message-migrate-from-chat-id #:message-pinned-message - #:message-connected-website - - #:message-chat-id - #:message-thread-id - #:message-id)) + #:message-connected-website)) (in-package :ukkoclot/tg-types/message) ;; If this is a MaybeInaccessibleMessage date will be 0 if this is inaccessible @@ -86,11 +92,11 @@ ;; (link-preview-options (or link-preview-options null) nil) ;; (suggested-post-info (or suggested-post-info null) nil) (effect-id (or string null) nil) - ;; (animation (or animation null) nil) + (animation (or animation null) nil) ;; (audio (or audio null) nil) ;; (document (or document null) nil) ;; (paid-media (or paid-media-info null) nil) - ;; (photo (or (array photo-size) null) nil) + (photo (or (array photo-size) null) nil) ;; (sticker (or sticker null) nil) ;; (story (or story null) nil) ;; (video (or video null) nil) @@ -109,7 +115,7 @@ (new-chat-members (or (array user) null) nil) ;; (left-chat-member (or user null) nil) (new-chat-title (or string null) nil) - ;; (new-chat-photo (or (array photo-size) null) nil) + (new-chat-photo (or (array photo-size) null) nil) (delete-chat-photo boolean nil) (group-chat-created boolean nil) (supergroup-chat-created boolean nil) diff --git a/src/tg-types/photo-size.lisp b/src/tg-types/photo-size.lisp new file mode 100644 index 0000000..2c8906d --- /dev/null +++ b/src/tg-types/photo-size.lisp @@ -0,0 +1,22 @@ +;; SPDX-License-Identifier: EUPL-1.2 +;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs +(defpackage :ukkoclot/tg-types/photo-size + (:use :c2cl :ukkoclot/tg-types/macros) + (:export + #:photo-size + #:make-photo-size + #:photo-size-p + #:copy-photo-size + #:photo-size-file-id + #:photo-size-file-unique-id + #:photo-size-width + #:photo-size-height + #:photo-size-file-size)) +(in-package :ukkoclot/tg-types/photo-size) + +(define-tg-type photo-size + (file-id string) + (file-unique-id string) + (width integer) + (height integer) + (file-size (or integer null) nil)) -- cgit v1.2.3