From 6b544b58dba095cafd6906d78b70bfd237397439 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sun, 19 Oct 2025 11:12:24 +0300 Subject: Fix lint issues --- src/tg.lisp | 1 - src/tg/animation.lisp | 1 + src/tg/answer-callback-query.lisp | 1 + src/tg/bot-name.lisp | 1 + src/tg/business-bot-rights.lisp | 1 + src/tg/business-connection.lisp | 1 + src/tg/callback-query.lisp | 1 + src/tg/chat-administrator-rights.lisp | 1 + src/tg/chat-type.lisp | 1 + src/tg/chat.lisp | 1 + src/tg/edit-message-text.lisp | 1 + src/tg/force-reply.lisp | 1 + src/tg/get-my-name.lisp | 1 + src/tg/get-updates.lisp | 1 + src/tg/inline-keyboard-button.lisp | 1 + src/tg/inline-keyboard-markup.lisp | 1 + src/tg/keyboard-button-poll-type.lisp | 15 ++++++--- src/tg/keyboard-button-request-chat.lisp | 1 + src/tg/keyboard-button-request-users.lisp | 1 + src/tg/keyboard-button.lisp | 1 + src/tg/link-preview-options.lisp | 1 + src/tg/message-entity-type.lisp | 47 ---------------------------- src/tg/message-entity.lisp | 51 +++++++++++++++++++++++++++++-- src/tg/message-reaction-updated.lisp | 1 + src/tg/message.lisp | 7 +++++ src/tg/parse-mode.lisp | 1 + src/tg/photo-size.lisp | 1 + src/tg/reaction-type-custom-emoji.lisp | 1 + src/tg/reaction-type-emoji.lisp | 1 + src/tg/reaction-type-paid.lisp | 1 + src/tg/reaction-type.lisp | 1 + src/tg/reply-keyboard-markup.lisp | 1 + src/tg/reply-keyboard-remove.lisp | 1 + src/tg/reply-parameters.lisp | 3 +- src/tg/suggested-post-parameters.lisp | 1 + src/tg/suggested-post-price.lisp | 13 ++++++-- src/tg/update.lisp | 1 + src/tg/user.lisp | 5 +++ src/tg/web-app-info.lisp | 1 + 39 files changed, 115 insertions(+), 58 deletions(-) delete mode 100644 src/tg/message-entity-type.lisp (limited to 'src') diff --git a/src/tg.lisp b/src/tg.lisp index ee83b9a..ebfe54d 100644 --- a/src/tg.lisp +++ b/src/tg.lisp @@ -27,7 +27,6 @@ :ukkoclot/src/tg/link-preview-options :ukkoclot/src/tg/message :ukkoclot/src/tg/message-entity - :ukkoclot/src/tg/message-entity-type :ukkoclot/src/tg/message-reaction-updated :ukkoclot/src/tg/parse-mode :ukkoclot/src/tg/photo-size diff --git a/src/tg/animation.lisp b/src/tg/animation.lisp index 3c95c1a..e213650 100644 --- a/src/tg/animation.lisp +++ b/src/tg/animation.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/animation + (:documentation "Animation Telegram type.") (:use :c2cl :ukkoclot/src/tg/type-macros :ukkoclot/src/tg/photo-size) (:export #:animation diff --git a/src/tg/answer-callback-query.lisp b/src/tg/answer-callback-query.lisp index 0bf958f..886d30e 100644 --- a/src/tg/answer-callback-query.lisp +++ b/src/tg/answer-callback-query.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/answer-callback-query + (:documentation "answerCallbackQuery Telegram method") (:use :c2cl :ukkoclot/src/tg/method-macros) (:export :answer-callback-query)) (in-package :ukkoclot/src/tg/answer-callback-query) diff --git a/src/tg/bot-name.lisp b/src/tg/bot-name.lisp index 3205b50..363d3d8 100644 --- a/src/tg/bot-name.lisp +++ b/src/tg/bot-name.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/bot-name + (:documentation "BotName Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:export #:bot-name diff --git a/src/tg/business-bot-rights.lisp b/src/tg/business-bot-rights.lisp index d683451..e267a2a 100644 --- a/src/tg/business-bot-rights.lisp +++ b/src/tg/business-bot-rights.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/business-bot-rights + (:documentation "BusinessBotRights Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:export #:business-bot-rights diff --git a/src/tg/business-connection.lisp b/src/tg/business-connection.lisp index ee2eb15..3a1c635 100644 --- a/src/tg/business-connection.lisp +++ b/src/tg/business-connection.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/business-connection + (:documentation "BusinessConnection Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros diff --git a/src/tg/callback-query.lisp b/src/tg/callback-query.lisp index 8dc88d1..984955a 100644 --- a/src/tg/callback-query.lisp +++ b/src/tg/callback-query.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/callback-query + (:documentation "CallbackQuery Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:use :ukkoclot/src/tg/message diff --git a/src/tg/chat-administrator-rights.lisp b/src/tg/chat-administrator-rights.lisp index 05f5fb7..e11ac14 100644 --- a/src/tg/chat-administrator-rights.lisp +++ b/src/tg/chat-administrator-rights.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/chat-administrator-rights + (:documentation "ChatAdministratorRights Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:export #:chat-administrator-rights diff --git a/src/tg/chat-type.lisp b/src/tg/chat-type.lisp index 4d19bd1..be68e25 100644 --- a/src/tg/chat-type.lisp +++ b/src/tg/chat-type.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/chat-type + (:documentation "ChatType Telegram type.") (:use :c2cl :ukkoclot/src/enum) (:export :channel :chat-type :group :private :supergroup)) (in-package :ukkoclot/src/tg/chat-type) diff --git a/src/tg/chat.lisp b/src/tg/chat.lisp index 6e2f2b7..445b1fd 100644 --- a/src/tg/chat.lisp +++ b/src/tg/chat.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/chat + (:documentation "Chat Telegram type") (:use :c2cl :ukkoclot/src/tg/chat-type :ukkoclot/src/tg/type-macros) (:export #:chat diff --git a/src/tg/edit-message-text.lisp b/src/tg/edit-message-text.lisp index 6038e43..14b3a2c 100644 --- a/src/tg/edit-message-text.lisp +++ b/src/tg/edit-message-text.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/edit-message-text + (:documentation "editMessageText Telegram method") (:use :c2cl :ukkoclot/src/tg/inline-keyboard-markup diff --git a/src/tg/force-reply.lisp b/src/tg/force-reply.lisp index a3e22f3..bd3711f 100644 --- a/src/tg/force-reply.lisp +++ b/src/tg/force-reply.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/force-reply + (:documentation "ForceReply Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:export #:force-reply diff --git a/src/tg/get-my-name.lisp b/src/tg/get-my-name.lisp index b7cb9bc..fe156a2 100644 --- a/src/tg/get-my-name.lisp +++ b/src/tg/get-my-name.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/get-my-name + (:documentation "getMyName Telegram method") (:use :c2cl :ukkoclot/src/tg/bot-name :ukkoclot/src/tg/method-macros) (:export :get-my-name)) (in-package :ukkoclot/src/tg/get-my-name) diff --git a/src/tg/get-updates.lisp b/src/tg/get-updates.lisp index 5a4da4f..aaecc73 100644 --- a/src/tg/get-updates.lisp +++ b/src/tg/get-updates.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/get-updates + (:documentation "getUpdates Telegram method") (:use :c2cl :ukkoclot/src/tg/method-macros :ukkoclot/src/tg/update) (:export :get-updates)) (in-package :ukkoclot/src/tg/get-updates) diff --git a/src/tg/inline-keyboard-button.lisp b/src/tg/inline-keyboard-button.lisp index 8d866a3..40153fe 100644 --- a/src/tg/inline-keyboard-button.lisp +++ b/src/tg/inline-keyboard-button.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/inline-keyboard-button + (:documentation "InlineKeyboardButton Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros :ukkoclot/src/tg/web-app-info) (:export #:inline-keyboard-button diff --git a/src/tg/inline-keyboard-markup.lisp b/src/tg/inline-keyboard-markup.lisp index ac5aab4..da7a168 100644 --- a/src/tg/inline-keyboard-markup.lisp +++ b/src/tg/inline-keyboard-markup.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/inline-keyboard-markup + (:documentation "InlineKeyboardMarkup Telegram type") (:use :c2cl :ukkoclot/src/tg/inline-keyboard-button :ukkoclot/src/tg/type-macros) (:export #:inline-keyboard-markup diff --git a/src/tg/keyboard-button-poll-type.lisp b/src/tg/keyboard-button-poll-type.lisp index da74da5..6ab91ea 100644 --- a/src/tg/keyboard-button-poll-type.lisp +++ b/src/tg/keyboard-button-poll-type.lisp @@ -1,14 +1,21 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/keyboard-button-poll-type - (:use :c2cl :ukkoclot/src/tg/type-macros) + (:documentation "KeyboardButtonPollType Telegram type") + (:use :c2cl :ukkoclot/src/enum :ukkoclot/src/tg/type-macros) (:export + #:keyboard-button-poll-type-type + #:quiz + #:regular #:keyboard-button-poll-type #:make-keyboard-button-poll-type #:keyboard-button-poll-type-p - #:copy-keyboard-button-poll-type - #:keyboard-button-poll-type-type)) + #:copy-keyboard-button-poll-type)) (in-package :ukkoclot/src/tg/keyboard-button-poll-type) +(define-enum keyboard-button-poll-type-type + (quiz "quiz") + (regular "regular")) + (define-tg-type keyboard-button-poll-type - (type (or string null) nil)) ;(member "quiz" "regular") or null + (type (or keyboard-button-poll-type-type null) nil)) diff --git a/src/tg/keyboard-button-request-chat.lisp b/src/tg/keyboard-button-request-chat.lisp index 981487e..b91ff95 100644 --- a/src/tg/keyboard-button-request-chat.lisp +++ b/src/tg/keyboard-button-request-chat.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/keyboard-button-request-chat + (:documentation "KeyboardButtonRequestChat Telegram type") (:use :c2cl :ukkoclot/src/tg/chat-administrator-rights :ukkoclot/src/tg/type-macros) (:export #:keyboard-button-request-chat diff --git a/src/tg/keyboard-button-request-users.lisp b/src/tg/keyboard-button-request-users.lisp index 4a22a21..a95b7a5 100644 --- a/src/tg/keyboard-button-request-users.lisp +++ b/src/tg/keyboard-button-request-users.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/keyboard-button-request-users + (:documentation "KeyboardButtonRequestUsers Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:export #:keyboard-button-request-users diff --git a/src/tg/keyboard-button.lisp b/src/tg/keyboard-button.lisp index 264b7c1..893c9a5 100644 --- a/src/tg/keyboard-button.lisp +++ b/src/tg/keyboard-button.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/keyboard-button + (:documentation "KeyboardButton Telegram type") (:use :c2cl :ukkoclot/src/tg/keyboard-button-poll-type diff --git a/src/tg/link-preview-options.lisp b/src/tg/link-preview-options.lisp index 3d1ff3f..c6272c2 100644 --- a/src/tg/link-preview-options.lisp +++ b/src/tg/link-preview-options.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/link-preview-options + (:documentation "LinkPreviewOptions Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:export #:link-preview-options diff --git a/src/tg/message-entity-type.lisp b/src/tg/message-entity-type.lisp deleted file mode 100644 index f964667..0000000 --- a/src/tg/message-entity-type.lisp +++ /dev/null @@ -1,47 +0,0 @@ -;; SPDX-License-Identifier: EUPL-1.2 -;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs -(defpackage :ukkoclot/src/tg/message-entity-type - (:use :c2cl :ukkoclot/src/enum) - (:export - :message-entity-type - :mention - :hashtag - :cashtag - :bot-command - :url-entity - :email - :phone-number - :bold - :italic - :underline - :strikethrough - :spoiler - :blockquote - :expandable-blockquote - :code - :pre - :text-link - :text-mention - :custom-emoji)) -(in-package :ukkoclot/src/tg/message-entity-type) - -(define-enum message-entity-type - (mention "mention") - (hashtag "hashtag") - (cashtag "cashtag") - (bot-command "bot_command") - (url-entity "url") - (email "email") - (phone-number "phone_number") - (bold "bold") - (italic "italic") - (underline "underline") - (strikethrough "strikethrough") - (spoiler "spoiler") - (blockquote "blockquote") - (expandable-blockquote "expandable_blockquote") - (code "code") - (pre "pre") - (text-link "text_link") - (text-mention "text_mention") - (custom-emoji "custom_emoji")) diff --git a/src/tg/message-entity.lisp b/src/tg/message-entity.lisp index feb3e8f..1a8cd27 100644 --- a/src/tg/message-entity.lisp +++ b/src/tg/message-entity.lisp @@ -1,13 +1,34 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/message-entity - (:use :c2cl :iterate :ukkoclot/src/tg/type-macros :ukkoclot/src/tg/message-entity-type :ukkoclot/src/tg/user) + (:documentation "MessageEntity Telegram type") + (:use :c2cl :iterate :ukkoclot/src/enum :ukkoclot/src/tg/type-macros :ukkoclot/src/tg/user) (:export + #:message-entity-type + #:mention + #:hashtag + #:cashtag + #:bot-command + #:url-entity + #:email + #:phone-number + #:bold + #:italic + #:underline + #:strikethrough + #:spoiler + #:blockquote + #:expandable-blockquote + #:code + #:pre + #:text-link + #:text-mention + #:custom-emoji + #:message-entity #:make-message-entity #:message-entity-p #:copy-message-entity - #:message-entity-type #:message-entity-offset #:message-entity-length #:message-entity-url @@ -18,6 +39,27 @@ #:message-entity-extract)) (in-package :ukkoclot/src/tg/message-entity) +(define-enum message-entity-type + (mention "mention") + (hashtag "hashtag") + (cashtag "cashtag") + (bot-command "bot_command") + (url-entity "url") + (email "email") + (phone-number "phone_number") + (bold "bold") + (italic "italic") + (underline "underline") + (strikethrough "strikethrough") + (spoiler "spoiler") + (blockquote "blockquote") + (expandable-blockquote "expandable_blockquote") + (code "code") + (pre "pre") + (text-link "text_link") + (text-mention "text_mention") + (custom-emoji "custom_emoji")) + (define-tg-type message-entity (type message-entity-type) (offset integer) @@ -31,11 +73,16 @@ (error "Some UTF-16 fuckery assumes that system chars are UTF-32")) (defun utf16-width (ch) + "Calculate the size of char in UTF-16 units." + (declare (type character ch)) (if (< (char-code ch) #x10000) 1 2)) (defun message-entity-extract (entity text) + "Extract the text corresponding to the ENTITY from the message text (in TEXT)." + (check-type entity message-entity) + (check-type text string) (with-slots (length offset) entity (if (zerop length) "" diff --git a/src/tg/message-reaction-updated.lisp b/src/tg/message-reaction-updated.lisp index 896bb9b..3e6c829 100644 --- a/src/tg/message-reaction-updated.lisp +++ b/src/tg/message-reaction-updated.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/message-reaction-updated + (:documentation "MessageReactionUpdated Telegram type") (:use :c2cl :ukkoclot/src/tg/chat diff --git a/src/tg/message.lisp b/src/tg/message.lisp index 6739189..13162a5 100644 --- a/src/tg/message.lisp +++ b/src/tg/message.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/message + (:documentation "Message Telegram type") (:use :c2cl :ukkoclot/src/tg/animation @@ -162,11 +163,17 @@ ;; (reply-markup (or inline-keyboard-markup null) nil) ) ; lint:suppress closing-parens-same-line whitespace-before-close-paren +(declaim (inline message-id)) (defun message-id (msg) + "Better named version of `message-message-id'." (message-message-id msg)) +(declaim (inline message-chat-id)) (defun message-chat-id (msg) + "Shortcut for (CHAT-ID (MESSAGE-CHAT MSG))." (chat-id (message-chat msg))) +(declaim (inline message-thread-id)) (defun message-thread-id (msg) + "Better named version of `message-message-thread-id'." (message-message-thread-id msg)) diff --git a/src/tg/parse-mode.lisp b/src/tg/parse-mode.lisp index 6fa37c3..b412394 100644 --- a/src/tg/parse-mode.lisp +++ b/src/tg/parse-mode.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/parse-mode + (:documentation "Different parsing modes for sending text") (:use :c2cl :ukkoclot/src/enum) (:export :html :markdown-legacy :markdown :parse-mode)) (in-package :ukkoclot/src/tg/parse-mode) diff --git a/src/tg/photo-size.lisp b/src/tg/photo-size.lisp index af8ff5e..04eb617 100644 --- a/src/tg/photo-size.lisp +++ b/src/tg/photo-size.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/photo-size + (:documentation "PhotoSize Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:export #:photo-size diff --git a/src/tg/reaction-type-custom-emoji.lisp b/src/tg/reaction-type-custom-emoji.lisp index 05ed3b7..943720d 100644 --- a/src/tg/reaction-type-custom-emoji.lisp +++ b/src/tg/reaction-type-custom-emoji.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/reaction-type-custom-emoji + (:documentation "ReactionTypeCustomEmoji Telegram type") (:use :c2cl :ukkoclot/src/enum :ukkoclot/src/tg/type-macros) (:export #:custom-emoji-type diff --git a/src/tg/reaction-type-emoji.lisp b/src/tg/reaction-type-emoji.lisp index 1e48b01..fd57385 100644 --- a/src/tg/reaction-type-emoji.lisp +++ b/src/tg/reaction-type-emoji.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/reaction-type-emoji + (:documentation "ReactionTypeEmoji Telegram type") (:use :c2cl :ukkoclot/src/enum :ukkoclot/src/tg/type-macros) (:export #:reaction-type-emoji-type diff --git a/src/tg/reaction-type-paid.lisp b/src/tg/reaction-type-paid.lisp index 413f9ae..d794ad2 100644 --- a/src/tg/reaction-type-paid.lisp +++ b/src/tg/reaction-type-paid.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/reaction-type-paid + (:documentation "ReactionTypePaid Telegram type") (:use :c2cl :ukkoclot/src/enum :ukkoclot/src/tg/type-macros) (:export #:reaction-type-paid-type diff --git a/src/tg/reaction-type.lisp b/src/tg/reaction-type.lisp index 356555d..15f722f 100644 --- a/src/tg/reaction-type.lisp +++ b/src/tg/reaction-type.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/reaction-type + (:documentation "ReactionType Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros diff --git a/src/tg/reply-keyboard-markup.lisp b/src/tg/reply-keyboard-markup.lisp index d6c0af3..6c24008 100644 --- a/src/tg/reply-keyboard-markup.lisp +++ b/src/tg/reply-keyboard-markup.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/reply-keyboard-markup + (:documentation "ReplyKeyboardMarkup Telegram type") (:use :c2cl :ukkoclot/src/tg/keyboard-button :ukkoclot/src/tg/type-macros) (:export #:reply-keyboard-markup diff --git a/src/tg/reply-keyboard-remove.lisp b/src/tg/reply-keyboard-remove.lisp index efed650..75a5c42 100644 --- a/src/tg/reply-keyboard-remove.lisp +++ b/src/tg/reply-keyboard-remove.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/reply-keyboard-remove + (:documentation "ReplyKeyboardRemove Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:export #:reply-keyboard-remove diff --git a/src/tg/reply-parameters.lisp b/src/tg/reply-parameters.lisp index d9c7b3b..152b57b 100644 --- a/src/tg/reply-parameters.lisp +++ b/src/tg/reply-parameters.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/reply-parameters + (:documentation "ReplyParameters Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros :ukkoclot/src/tg/message-entity) (:export #:reply-parameters @@ -21,7 +22,7 @@ (message-id integer) (chat-id (or integer string null) nil) ;; TODO: This should be a ternary true, false, default - (allow-sending-without-reply boolean nil) + (allow-sending-without-reply boolean nil :skip-if-default nil) (quote (or string null) nil) (quote-parse-mode (or string null) nil) (quote-entities (or (array message-entity) null) nil) diff --git a/src/tg/suggested-post-parameters.lisp b/src/tg/suggested-post-parameters.lisp index f68d49a..43a7462 100644 --- a/src/tg/suggested-post-parameters.lisp +++ b/src/tg/suggested-post-parameters.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/suggested-post-parameters + (:documentation "SuggestedPostParameters Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros :ukkoclot/src/tg/suggested-post-price) (:export #:suggested-post-parameters diff --git a/src/tg/suggested-post-price.lisp b/src/tg/suggested-post-price.lisp index b8eaa21..f12a768 100644 --- a/src/tg/suggested-post-price.lisp +++ b/src/tg/suggested-post-price.lisp @@ -1,16 +1,23 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/suggested-post-price - (:use :c2cl :ukkoclot/src/tg/type-macros) + (:documentation "SuggestedPostPrice Telegram type") + (:use :c2cl :ukkoclot/src/enum :ukkoclot/src/tg/type-macros) (:export + #:suggested-post-price-currency + #:stars + #:ton #:suggested-post-price #:make-suggested-post-price #:suggested-post-price-p #:copy-suggested-post-price - #:suggested-post-price-currency #:suggested-post-price-amount)) (in-package :ukkoclot/src/tg/suggested-post-price) +(define-enum suggested-post-price-currency + (stars "XTR") + (ton "TON")) + (define-tg-type suggested-post-price - (currency string) ;(member "XTR" "TON") + (currency suggested-post-price-currency) (amount integer)) diff --git a/src/tg/update.lisp b/src/tg/update.lisp index cc4b6d3..20927ee 100644 --- a/src/tg/update.lisp +++ b/src/tg/update.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/update + (:documentation "Update Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros diff --git a/src/tg/user.lisp b/src/tg/user.lisp index 2549d66..0768d12 100644 --- a/src/tg/user.lisp +++ b/src/tg/user.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/user + (:documentation "User Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:import-from :ukkoclot/src/strings :escape-xml) (:export @@ -39,6 +40,7 @@ (can-connect-to-business boolean nil)) (defun user-format-name% (user out) + "Format the USER's name in a nice way to stream OUT." (format out "" (user-id user)) (escape-xml (user-first-name user) out) (when (user-last-name user) @@ -53,6 +55,9 @@ (format out " [~A]" (user-id user))) (defun user-format-name (user &optional out) + "Format the USER's name in a nice way to stream OUT. + +If OUT is `nil', return the formatted name as a string instead." (if out (user-format-name% user out) (with-output-to-string (stream) diff --git a/src/tg/web-app-info.lisp b/src/tg/web-app-info.lisp index 6126aa3..d255a69 100644 --- a/src/tg/web-app-info.lisp +++ b/src/tg/web-app-info.lisp @@ -1,6 +1,7 @@ ;; SPDX-License-Identifier: EUPL-1.2 ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs (defpackage :ukkoclot/src/tg/web-app-info + (:documentation "WebAppInfo Telegram type") (:use :c2cl :ukkoclot/src/tg/type-macros) (:export #:web-app-info -- cgit v1.2.3