From 5e6b7a1248e175e8c550ce9feed7745292f17bfe Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Fri, 10 Oct 2025 07:13:19 +0300 Subject: Add a helper reply-message function --- src/bot/advanced.lisp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/bot/advanced.lisp (limited to 'src/bot/advanced.lisp') diff --git a/src/bot/advanced.lisp b/src/bot/advanced.lisp new file mode 100644 index 0000000..a6ad9ba --- /dev/null +++ b/src/bot/advanced.lisp @@ -0,0 +1,29 @@ +;; SPDX-License-Identifier: EUPL-1.2 +;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs +(defpackage :ukkoclot/bot/advanced + (:use :c2cl :ukkoclot/bot/impl :ukkoclot/bot/methods :ukkoclot/tg-types) + (:export :bot-id :bot-username :reply-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)))) + +(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)))) -- cgit v1.2.3