From 8b8bd2b811ed4097a3aaf8785d233bd012d22ac0 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Mon, 13 Oct 2025 06:48:00 +0300 Subject: Move bot/adanced to tg/* --- src/bot/advanced.lisp | 55 --------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 src/bot/advanced.lisp (limited to 'src/bot') diff --git a/src/bot/advanced.lisp b/src/bot/advanced.lisp deleted file mode 100644 index 3763151..0000000 --- a/src/bot/advanced.lisp +++ /dev/null @@ -1,55 +0,0 @@ -;; SPDX-License-Identifier: EUPL-1.2 -;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs -(defpackage :ukkoclot/bot/advanced - (:use :c2cl :ukkoclot/tg) - (:import-from :ukkoclot/state :bot-id% :bot-username%) - (:export :bot-id :bot-username :reply-animation :reply-message :try-delete-message)) -(in-package :ukkoclot/bot/advanced) - -(defun bot-id (bot) - (or (bot-id% bot) - (progn - (get-me bot) - (bot-id% bot)))) - -(defun bot-username (bot) - (or (bot-username% bot) - (progn - (get-me bot) - (bot-username% bot)))) - -;; 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)))) - -(defun reply-message (bot msg text &key parse-mode allow-sending-without-reply) - (send-message bot - :chat-id (message-chat-id msg) - :text text - :parse-mode parse-mode - :reply-parameters - (make-reply-parameters - :allow-sending-without-reply allow-sending-without-reply - :message-id (message-id msg) - :chat-id (message-chat-id msg)))) - -(defun try-delete-message (bot msg) - (handler-case - (delete-message bot - :chat-id (message-chat-id msg) - :message-id (message-id msg)) - (error () - (handler-case - (reply-animation bot msg #P"blob/do-not.mp4" - :allow-sending-without-reply nil) - (error () nil))))) -- cgit v1.2.3