diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py index 8f5f0091ec..1209f40c63 100644 --- a/compiler/docs/compiler.py +++ b/compiler/docs/compiler.py @@ -274,6 +274,7 @@ def get_title_list(s: str) -> list: get_chat_photos get_chat_photos_count set_profile_photo + set_personal_channel delete_profile_photos set_username update_profile @@ -285,7 +286,6 @@ def get_title_list(s: str) -> list: update_status check_username update_birthday - update_personal_channel """, invite_links=""" Invite Links diff --git a/pyrogram/methods/users/__init__.py b/pyrogram/methods/users/__init__.py index cf34b434f0..9682bc7c77 100644 --- a/pyrogram/methods/users/__init__.py +++ b/pyrogram/methods/users/__init__.py @@ -26,11 +26,11 @@ from .get_me import GetMe from .get_users import GetUsers from .set_emoji_status import SetEmojiStatus +from .set_personal_channel import SetPersonalChannel from .set_profile_photo import SetProfilePhoto from .set_username import SetUsername from .unblock_user import UnblockUser from .update_birthday import UpdateBirthday -from .update_personal_channel import UpdatePersonalChannel from .update_profile import UpdateProfile from .update_status import UpdateStatus @@ -40,6 +40,7 @@ class Users( CheckUsername, GetCommonChats, GetChatPhotos, + SetPersonalChannel, SetProfilePhoto, DeleteProfilePhotos, GetUsers, @@ -48,7 +49,6 @@ class Users( GetChatPhotosCount, UnblockUser, UpdateBirthday, - UpdatePersonalChannel, UpdateProfile, UpdateStatus, GetDefaultEmojiStatuses, diff --git a/pyrogram/methods/users/update_personal_channel.py b/pyrogram/methods/users/set_personal_channel.py similarity index 81% rename from pyrogram/methods/users/update_personal_channel.py rename to pyrogram/methods/users/set_personal_channel.py index 2b26c3835f..d06f26cdd0 100644 --- a/pyrogram/methods/users/update_personal_channel.py +++ b/pyrogram/methods/users/set_personal_channel.py @@ -16,18 +16,18 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from typing import Union +from typing import Union, Optional import pyrogram from pyrogram import raw -class UpdatePersonalChannel: - async def update_personal_channel( +class SetPersonalChannel: + async def set_personal_channel( self: "pyrogram.Client", - chat_id: Union[int, str] = None + chat_id: Optional[Union[int, str]] = None ) -> bool: - """Update your personal channel. + """Set a personal channel in bio. .. include:: /_includes/usable-by/users.rst @@ -42,18 +42,18 @@ async def update_personal_channel( Example: .. code-block:: python - # Update your personal channel - await app.update_personal_channel(chat_id) + # Set your personal channel + await app.set_personal_channel(chat_id) # Remove personal channel from your profile - await app.update_personal_channel() + await app.set_personal_channel() """ if chat_id is None: peer = raw.types.InputChannelEmpty() else: peer = await self.resolve_peer(chat_id) - if not isinstance(peer, raw.types.InputChannel): + if not isinstance(peer, raw.types.InputPeerChannel): return False return bool(