From deddcf540eba16244a264583c000d5f9018342cb Mon Sep 17 00:00:00 2001 From: uburuntu Date: Tue, 19 Nov 2019 20:40:18 +0300 Subject: [PATCH] enh: add check for private chat --- aiogram/types/chat.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index 1792613c..3f0c4e10 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -70,6 +70,8 @@ class Chat(base.TelegramObject): For example: -1001122334455 -> 1122334455 """ + if self.type == ChatType.PRIVATE: + raise TypeError('`shifted_id` property is not available for private chats') shift = -1000000000000 return shift - self.id