mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
enh: add check for private chat
This commit is contained in:
parent
b8cfe386da
commit
deddcf540e
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue