From 8fc00c6ec1a6622934ad8fd79699823dcbb14e34 Mon Sep 17 00:00:00 2001 From: Denis Malin Date: Thu, 29 Jun 2023 20:58:17 +0400 Subject: [PATCH] fix unpin --- src/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 603a703..9f09719 100644 --- a/src/main.py +++ b/src/main.py @@ -139,7 +139,10 @@ async def inline_query(client, query): pin = await PinMessage.query \ .where(PinMessage.chat_id == query.message.chat.id) \ - .where(PinMessage.message_id == query.message.reply_to_message.id).gino.first() + .where(PinMessage.message_id.in_([ + query.message.reply_to_message.id, + query.message.reply_to_message.pinned_message.id, + ])).gino.first() if data in ('infinitely', 'ok'): if data == 'infinitely':