mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Add is_creator field to Chat object (#306)
* Add is_creator field to Chat object * Update chat.py
This commit is contained in:
parent
8b4dd1fa4a
commit
cedb87ef41
@ -44,6 +44,9 @@ class Chat(Object):
|
|||||||
True, if this chat has been restricted. Supergroups, channels and bots only.
|
True, if this chat has been restricted. Supergroups, channels and bots only.
|
||||||
See *restriction_reason* for details.
|
See *restriction_reason* for details.
|
||||||
|
|
||||||
|
is_creator (``bool``, *optional*):
|
||||||
|
True, if this chat owner is the current user. Supergroups, channels and groups only.
|
||||||
|
|
||||||
is_scam (``bool``, *optional*):
|
is_scam (``bool``, *optional*):
|
||||||
True, if this chat has been flagged for scam. Supergroups, channels and bots only.
|
True, if this chat has been flagged for scam. Supergroups, channels and bots only.
|
||||||
|
|
||||||
@ -108,6 +111,7 @@ class Chat(Object):
|
|||||||
type: str,
|
type: str,
|
||||||
is_verified: bool = None,
|
is_verified: bool = None,
|
||||||
is_restricted: bool = None,
|
is_restricted: bool = None,
|
||||||
|
is_creator: bool = None,
|
||||||
is_scam: bool = None,
|
is_scam: bool = None,
|
||||||
is_support: bool = None,
|
is_support: bool = None,
|
||||||
title: str = None,
|
title: str = None,
|
||||||
@ -131,6 +135,7 @@ class Chat(Object):
|
|||||||
self.type = type
|
self.type = type
|
||||||
self.is_verified = is_verified
|
self.is_verified = is_verified
|
||||||
self.is_restricted = is_restricted
|
self.is_restricted = is_restricted
|
||||||
|
self.is_creator = is_creator
|
||||||
self.is_scam = is_scam
|
self.is_scam = is_scam
|
||||||
self.is_support = is_support
|
self.is_support = is_support
|
||||||
self.title = title
|
self.title = title
|
||||||
@ -175,6 +180,7 @@ class Chat(Object):
|
|||||||
id=peer_id,
|
id=peer_id,
|
||||||
type="group",
|
type="group",
|
||||||
title=chat.title,
|
title=chat.title,
|
||||||
|
is_creator=getattr(channel, "creator", None),
|
||||||
photo=ChatPhoto._parse(client, getattr(chat, "photo", None), peer_id, 0),
|
photo=ChatPhoto._parse(client, getattr(chat, "photo", None), peer_id, 0),
|
||||||
permissions=ChatPermissions._parse(getattr(chat, "default_banned_rights", None)),
|
permissions=ChatPermissions._parse(getattr(chat, "default_banned_rights", None)),
|
||||||
members_count=getattr(chat, "participants_count", None),
|
members_count=getattr(chat, "participants_count", None),
|
||||||
@ -191,6 +197,7 @@ class Chat(Object):
|
|||||||
type="supergroup" if channel.megagroup else "channel",
|
type="supergroup" if channel.megagroup else "channel",
|
||||||
is_verified=getattr(channel, "verified", None),
|
is_verified=getattr(channel, "verified", None),
|
||||||
is_restricted=getattr(channel, "restricted", None),
|
is_restricted=getattr(channel, "restricted", None),
|
||||||
|
is_creator=getattr(channel, "creator", None),
|
||||||
is_scam=getattr(channel, "scam", None),
|
is_scam=getattr(channel, "scam", None),
|
||||||
title=channel.title,
|
title=channel.title,
|
||||||
username=getattr(channel, "username", None),
|
username=getattr(channel, "username", None),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user