From 3231d8c2632eb44455a921231b7382ac967db615 Mon Sep 17 00:00:00 2001 From: Rykov7 Date: Sat, 16 Mar 2024 18:55:06 +0300 Subject: [PATCH] add adding selected text to quotes, instead of full text of replied message --- src/stan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stan.py b/src/stan.py index a28d2bb..7b8c9e3 100644 --- a/src/stan.py +++ b/src/stan.py @@ -60,7 +60,7 @@ async def mute(chat_id, user_id, period): @bot.message_handler(func=is_white_id, commands=["add"]) async def add_stan_quote(message: types.Message): if message.reply_to_message and message.reply_to_message.text: - quote = message.reply_to_message.text + quote = (message.quote and message.quote.text) or message.reply_to_message.text if not is_quote_in_chat(quote, message.chat.id): add_quote(message.chat.id, quote) ok_message = await bot.send_message(message.chat.id, f"⭐️ Добавил: {quote}", parse_mode='Markdown') @@ -75,7 +75,7 @@ async def add_stan_quote(message: types.Message): @bot.message_handler(func=is_white_id, commands=["remove"]) async def remove_stan_quote(message: types.Message): if message.reply_to_message and message.reply_to_message.text: - quote = message.reply_to_message.text + quote = (message.quote and message.quote.text) or message.reply_to_message.text if is_quote_in_chat(quote, message.chat.id): delete_quote_in_chat(quote, message.chat.id) remove_message = await bot.send_message(message.chat.id, f"🗑 Удалил: {quote}", parse_mode='Markdown')