Skip to content
Permalink
Browse files

Rename set_custom_title to set_administrator_title and clarify

  • Loading branch information...
delivrance committed Sep 9, 2019
1 parent a015f99 commit 80c7a6e98891d23d0215a8cefe4dc98571def4ed
@@ -184,6 +184,7 @@ def get_title_list(s: str) -> list:
unban_chat_member
restrict_chat_member
promote_chat_member
set_administrator_title
export_chat_invite_link
set_chat_photo
delete_chat_photo
@@ -40,11 +40,11 @@
from .pin_chat_message import PinChatMessage
from .promote_chat_member import PromoteChatMember
from .restrict_chat_member import RestrictChatMember
from .set_administrator_title import SetAdministratorTitle
from .set_chat_description import SetChatDescription
from .set_chat_permissions import SetChatPermissions
from .set_chat_photo import SetChatPhoto
from .set_chat_title import SetChatTitle
from .set_custom_title import SetCustomTitle
from .unarchive_chats import UnarchiveChats
from .unban_chat_member import UnbanChatMember
from .unpin_chat_message import UnpinChatMessage
@@ -84,6 +84,6 @@ class Chats(
DeleteChannel,
DeleteSupergroup,
GetNearbyChats,
SetCustomTitle
SetAdministratorTitle
):
pass
@@ -22,14 +22,17 @@
from ...ext import BaseClient


class SetCustomTitle(BaseClient):
def set_custom_title(
class SetAdministratorTitle(BaseClient):
def set_administrator_title(
self,
chat_id: Union[int, str],
user_id: Union[int, str],
title: str,
) -> bool:
"""Set a custom title to administrators or owners of a supergroup.
"""Set a custom title (rank) to an administrator of a supergroup.
If you are an administrator of a supergroup (i.e. not the owner), you can only set the title of other
administrators who have been promoted by you. If you are the owner, you can change every administrator's title.
Parameters:
chat_id (``int`` | ``str``):
@@ -49,8 +52,7 @@ def set_custom_title(
Example:
.. code-block:: python
# Set custom titles to owners or administrators of supergroups
app.set_custom_title(chat_id, user_id, "Custom Title")
app.set_administrator_title(chat_id, user_id, "ฅ^•ﻌ•^ฅ")
"""
chat_id = self.resolve_peer(chat_id)
user_id = self.resolve_peer(user_id)

0 comments on commit 80c7a6e

Please sign in to comment.
You can’t perform that action at this time.