Skip to content

Commit b425ad3

Browse files
author
Pyrogram-Mod - Dev
committed
Add PEER_LINK_NOT_MODIFIED error and document community method raises
1 parent 308dae3 commit b425ad3

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

compiler/errors/source/400_BAD_REQUEST.tsv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ PEER_FLOOD The current account is spamreported, you cannot execute this action,
363363
PEER_HISTORY_EMPTY You can't pin an empty chat with a user.
364364
PEER_ID_INVALID The provided peer id is invalid.
365365
PEER_ID_NOT_SUPPORTED The provided peer ID is not supported.
366+
PEER_LINK_NOT_MODIFIED The specified peer is already linked (or unlinked) from the community, no change was needed.
366367
PEER_TYPES_INVALID The passed [keyboardButtonSwitchInline](https://core.telegram.org/constructor/keyboardButtonSwitchInline).`peer_types` field is invalid.
367368
PERSISTENT_TIMESTAMP_EMPTY Persistent timestamp empty.
368369
PERSISTENT_TIMESTAMP_INVALID Persistent timestamp invalid.

pyrogram/methods/communities/add_chat_to_community.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ async def add_chat_to_community(
4949
Returns:
5050
``bool``: True on success.
5151
52+
Raises:
53+
~pyrogram.errors.PeerLinkNotModified: The chat is already linked
54+
to the community.
55+
~pyrogram.errors.ChatAdminRequired: The user is not an admin of
56+
the community or the chat.
57+
5258
Example:
5359
.. code-block:: python
5460

pyrogram/methods/communities/toggle_community_peer_link.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ async def toggle_community_peer_link(
3636
Returns:
3737
``bool``: True on success.
3838
39+
Raises:
40+
~pyrogram.errors.PeerLinkNotModified: The peer is already in the
41+
requested state (e.g. already visible, already hidden, or
42+
already deleted).
43+
~pyrogram.errors.ChatAdminRequired: The user is not an admin of
44+
the community.
45+
3946
Example:
4047
.. code-block:: python
4148

0 commit comments

Comments
 (0)