Visitar URL original
Document delete_chat_photo · usergao/pyrogram@3fcf9b9 · GitHub
Skip to content

Commit 3fcf9b9

Browse files
committed
Document delete_chat_photo
1 parent 9857816 commit 3fcf9b9

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

‎pyrogram/client/methods/chats/delete_chat_photo.py‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,26 @@
2222

2323
class DeleteChatPhoto(BaseClient):
2424
def delete_chat_photo(self, chat_id: int or str):
25-
# TODO: Docstrings
25+
"""Use this method to delete a chat photo.
26+
Photos can't be changed for private chats.
27+
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
28+
29+
Note:
30+
In regular groups (non-supergroups), this method will only work if the "All Members Are Admins"
31+
setting is off.
32+
33+
Args:
34+
chat_id (``int`` | ``str``):
35+
Unique identifier (int) or username (str) of the target chat.
36+
For a private channel/supergroup you can use its *t.me/joinchat/* link.
37+
38+
Returns:
39+
True on success.
40+
41+
Raises:
42+
:class:`Error <pyrogram.Error>`
43+
``ValueError``: If a chat_id belongs to user.
44+
"""
2645
peer = self.resolve_peer(chat_id)
2746

2847
if isinstance(peer, types.InputPeerChat):

0 commit comments

Comments
 (0)