mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
Document set_chat_description
This commit is contained in:
parent
15e83e12ca
commit
98578160f0
1 changed files with 18 additions and 1 deletions
|
|
@ -22,7 +22,24 @@ from ...ext import BaseClient
|
|||
|
||||
class SetChatDescription(BaseClient):
|
||||
def set_chat_description(self, chat_id: int or str, description: str):
|
||||
# TODO: Docstrings
|
||||
"""Use this method to change the description of a supergroup or a channel.
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
||||
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.
|
||||
|
||||
description (``str``):
|
||||
New chat description, 0-255 characters.
|
||||
|
||||
Returns:
|
||||
True on success.
|
||||
|
||||
Raises:
|
||||
:class:`Error <pyrogram.Error>`
|
||||
``ValueError``: If a chat_id doesn't belong to a supergroup or a channel.
|
||||
"""
|
||||
peer = self.resolve_peer(chat_id)
|
||||
|
||||
if isinstance(peer, types.InputPeerChannel):
|
||||
|
|
|
|||
Loading…
Reference in a new issue