enh: add check for private chat

This commit is contained in:
uburuntu 2019-11-19 20:40:18 +03:00
parent b8cfe386da
commit deddcf540e

View file

@ -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