Skip to content

Commit

Permalink
Rename update_personal_channel to set_personal_channel
Browse files Browse the repository at this point in the history
  • Loading branch information
KurimuzonAkuma committed Jul 16, 2024
1 parent 0cda4f9 commit de078d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion compiler/docs/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -285,7 +286,6 @@ def get_title_list(s: str) -> list:
update_status
check_username
update_birthday
update_personal_channel
""",
invite_links="""
Invite Links
Expand Down
4 changes: 2 additions & 2 deletions pyrogram/methods/users/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -40,6 +40,7 @@ class Users(
CheckUsername,
GetCommonChats,
GetChatPhotos,
SetPersonalChannel,
SetProfilePhoto,
DeleteProfilePhotos,
GetUsers,
Expand All @@ -48,7 +49,6 @@ class Users(
GetChatPhotosCount,
UnblockUser,
UpdateBirthday,
UpdatePersonalChannel,
UpdateProfile,
UpdateStatus,
GetDefaultEmojiStatuses,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.

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
Expand All @@ -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(
Expand Down

0 comments on commit de078d8

Please sign in to comment.