mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Document delete_chat_photo
This commit is contained in:
parent
98578160f0
commit
3fcf9b9ef6
@ -22,7 +22,26 @@ from ...ext import BaseClient
|
|||||||
|
|
||||||
class DeleteChatPhoto(BaseClient):
|
class DeleteChatPhoto(BaseClient):
|
||||||
def delete_chat_photo(self, chat_id: int or str):
|
def delete_chat_photo(self, chat_id: int or str):
|
||||||
# TODO: Docstrings
|
"""Use this method to delete a chat photo.
|
||||||
|
Photos can't be changed for private chats.
|
||||||
|
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||||
|
|
||||||
|
Note:
|
||||||
|
In regular groups (non-supergroups), this method will only work if the "All Members Are Admins"
|
||||||
|
setting is off.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
chat_id (``int`` | ``str``):
|
||||||
|
Unique identifier (int) or username (str) of the target chat.
|
||||||
|
For a private channel/supergroup you can use its *t.me/joinchat/* link.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
True on success.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
:class:`Error <pyrogram.Error>`
|
||||||
|
``ValueError``: If a chat_id belongs to user.
|
||||||
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
|
||||||
if isinstance(peer, types.InputPeerChat):
|
if isinstance(peer, types.InputPeerChat):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user